diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml deleted file mode 100644 index cb7edb8..0000000 --- a/.github/workflows/verify.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: verify - -on: push - -jobs: - verify: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - - name: Set up Python - uses: actions/setup-python@v1 - - - name: Install dependencies - run: pip3 install -U online-judge-verify-helper - - - name: Run tests - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - YUKICODER_TOKEN: ${{ secrets.YUKICODER_TOKEN }} - GH_PAT: ${{ secrets.GH_PAT }} - run: oj-verify all diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json deleted file mode 100644 index 1d1df64..0000000 --- a/.verify-helper/timestamps.remote.json +++ /dev/null @@ -1,71 +0,0 @@ -{ -"Test/AOJ/ALDS1/ALDS1_13_A.test.py": "2022-08-11 00:02:49 +0900", -"Test/AOJ/ALDS1/ALDS1_1_B.test.py": "2022-08-11 00:02:49 +0900", -"Test/AOJ/ALDS1/ALDS1_1_C.test.py": "2023-06-29 17:50:03 +0900", -"Test/AOJ/ALDS1/ALDS1_4_B.test.py": "2023-06-30 09:12:08 +0900", -"Test/AOJ/ALDS1/ALDS1_5_D.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/DSL/DSL_1_A.test.py": "2024-04-23 12:17:37 +0900", -"Test/AOJ/GRL/GRL_1_A.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/GRL/GRL_1_B.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/ITP1/ALDS1_10_C.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/ITP1/ALDS1_10_D.test.py": "2023-06-30 14:54:43 +0900", -"Test/AOJ/ITP1/ITP1_11_A.test.py": "2023-06-29 00:35:03 +0900", -"Test/AOJ/ITP1/ITP1_11_B.test.py": "2023-06-29 00:35:03 +0900", -"Test/AOJ/ITP1/ITP1_11_C.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/ITP1/ITP1_11_D.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/ITP1/ITP1_2_A.test.py": "2023-06-29 00:35:03 +0900", -"Test/AOJ/ITP1/ITP1_3_D.test.py": "2023-06-29 00:35:03 +0900", -"Test/AOJ/ITP1/ITP1_8_B.test.py": "2023-06-30 10:01:09 +0900", -"Test/AOJ/Volume0/0000.test.py": "2022-08-11 00:02:49 +0900", -"Test/AOJ/Volume0/0001.test.py": "2023-07-01 01:49:57 +0900", -"Test/AOJ/Volume10/1000.test.py": "2023-06-29 01:19:46 +0900", -"Test/AOJ/Volume11/1147.test.py": "2023-06-29 01:08:34 +0900", -"Test/AOJ/Volume11/1153.test.py": "2023-06-29 01:08:34 +0900", -"Test/AOJ/Volume11/1172.test.py": "2023-06-29 01:19:46 +0900", -"Test/AOJ/Volume16/1608.test.py": "2023-06-29 01:08:34 +0900", -"Test/AOJ/Volume16/1640.test.py": "2023-06-29 00:35:03 +0900", -"Test/AOJ/Volume21/2197.test.py": "2023-06-29 01:37:18 +0900", -"Test/AOJ/Volume29/2944.test.py": "2023-06-29 15:39:20 +0900", -"Test/AOJ/Volume32/3202.test.py": "1970-01-01 00:00:00 +0000", -"Test/AOJ/Volume5/0516.test.py": "2023-06-29 17:50:03 +0900", -"Test/yosupo/DataStructure/StaticRMQ.test.py": "2022-08-11 00:02:49 +0900", -"Test/yosupo/DataStructure/Unionfind.test.py": "2024-04-23 12:17:37 +0900", -"Test/yosupo/Sample/A+B.test.py": "2023-06-29 00:35:03 +0900", -"Test/yosupo/Sample/ManyA+B.test.py": "2023-06-29 00:35:03 +0900", -"Test/yukicoder/0001.test.py": "1970-01-01 00:00:00 +0000", -"Test/yukicoder/0002.test.py": "2023-12-02 20:13:06 +0900", -"Test/yukicoder/0003.test.py": "1970-01-01 00:00:00 +0000", -"Test/yukicoder/0004.test.py": "2023-07-01 01:32:50 +0900", -"Test/yukicoder/0005.test.py": "2023-07-01 01:32:50 +0900", -"Test/yukicoder/0007.test.py": "2023-07-01 01:32:50 +0900", -"Test/yukicoder/0008.test.py": "2023-07-01 01:32:50 +0900", -"Test/yukicoder/0009.test.py": "1970-01-01 00:00:00 +0000", -"Test/yukicoder/0044.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0053.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0064.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0167.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0182.test.py": "1970-01-01 00:00:00 +0000", -"Test/yukicoder/0208.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0244.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0314.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0677.test.py": "2023-04-18 14:48:46 +0900", -"Test/yukicoder/0697.test.py": "1970-01-01 00:00:00 +0000", -"Test/yukicoder/0713.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/0847.test.py": "2023-12-02 20:13:06 +0900", -"Test/yukicoder/1003.test.py": "2023-06-29 15:39:20 +0900", -"Test/yukicoder/1155.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/1367.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/1454.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/1639.test.py": "2022-08-11 00:02:49 +0900", -"Test/yukicoder/1737.test.py": "2023-12-02 20:13:06 +0900", -"Test/yukicoder/1749.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/1808.test.py": "2023-04-18 20:40:05 +0900", -"Test/yukicoder/2034.test.py": "1970-01-01 00:00:00 +0000", -"Test/yukicoder/2093.test.py": "2023-06-29 15:39:20 +0900", -"Test/yukicoder/2371.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/2373.test.py": "2023-07-09 23:09:33 +0900", -"Test/yukicoder/2557.test.py": "2023-12-02 20:13:06 +0900", -"Test/yukicoder/2558.test.py": "2023-12-02 20:13:06 +0900", -"Test/yukicoder/2559.test.py": "2023-12-02 20:13:06 +0900", -"Test/yukicoder/2570.test.py": "2023-12-02 20:24:38 +0900" -} \ No newline at end of file diff --git a/DP/LongestCommonSubsequence.py b/DP/LongestCommonSubsequence.py deleted file mode 100644 index 9478636..0000000 --- a/DP/LongestCommonSubsequence.py +++ /dev/null @@ -1,27 +0,0 @@ -def LCS(S, T): - L1 = len(S) - L2 = len(T) - dp = [[0] * (L2 + 1) for i in range(L1 + 1)] - - for i in range(L1 - 1, -1, -1): - for j in range(L2 - 1, -1, -1): - r = max(dp[i + 1][j], dp[i][j + 1]) - if S[i] == T[j]: - r = max(r, dp[i + 1][j + 1] + 1) - dp[i][j] = r - # dp[0][0] が長さの解 - - # ここからは復元処理 - res = [] - i = 0; j = 0 - while i < L1 and j < L2: - if S[i] == T[j]: - res.append(S[i]) - i += 1; j += 1 - elif dp[i][j] == dp[i + 1][j]: - i += 1 - elif dp[i][j] == dp[i][j + 1]: - j += 1 - return "".join(res) - -print(LCS("asdcsascsadsd", "assdcascdascasca")) \ No newline at end of file diff --git a/DP/LongestCommonSubsequence.py.md b/DP/LongestCommonSubsequence.py.md new file mode 100644 index 0000000..1719885 --- /dev/null +++ b/DP/LongestCommonSubsequence.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def LCS(S, T):\n L1 = len(S)\n L2 = len(T)\n dp = [[0] * (L2 + 1)\ + \ for i in range(L1 + 1)]\n\n for i in range(L1 - 1, -1, -1):\n for\ + \ j in range(L2 - 1, -1, -1):\n r = max(dp[i + 1][j], dp[i][j + 1])\n\ + \ if S[i] == T[j]:\n r = max(r, dp[i + 1][j + 1] + 1)\n\ + \ dp[i][j] = r\n # dp[0][0] \u304C\u9577\u3055\u306E\u89E3\n\n \ + \ # \u3053\u3053\u304B\u3089\u306F\u5FA9\u5143\u51E6\u7406\n res = []\n \ + \ i = 0; j = 0\n while i < L1 and j < L2:\n if S[i] == T[j]:\n \ + \ res.append(S[i])\n i += 1; j += 1\n elif dp[i][j]\ + \ == dp[i + 1][j]:\n i += 1\n elif dp[i][j] == dp[i][j + 1]:\n\ + \ j += 1\n return \"\".join(res)\n\nprint(LCS(\"asdcsascsadsd\"\ + , \"assdcascdascasca\"))" + dependsOn: [] + isVerificationFile: false + path: DP/LongestCommonSubsequence.py + requiredBy: [] + timestamp: '2022-05-22 23:05:29+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: DP/LongestCommonSubsequence.py +layout: document +redirect_from: +- /library/DP/LongestCommonSubsequence.py +- /library/DP/LongestCommonSubsequence.py.html +title: DP/LongestCommonSubsequence.py +--- diff --git a/DP/LongestIncreasingSubsequence.py b/DP/LongestIncreasingSubsequence.py deleted file mode 100644 index ab35e92..0000000 --- a/DP/LongestIncreasingSubsequence.py +++ /dev/null @@ -1,16 +0,0 @@ -from bisect import bisect_left - -def LIS(n: int, a: list) -> int: - INF = 10 ** 18 - dp = [INF] * n - for i in a: - x = bisect_left(dp, i) - dp[x] = i - - return bisect_left(dp, INF) - -n = int(input()) -a = list(map(int, input().split())) - -cnt = LIS(n, a) -print(cnt) \ No newline at end of file diff --git a/DP/LongestIncreasingSubsequence.py.md b/DP/LongestIncreasingSubsequence.py.md new file mode 100644 index 0000000..f7816a9 --- /dev/null +++ b/DP/LongestIncreasingSubsequence.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from bisect import bisect_left\n\ndef LIS(n: int, a: list) -> int:\n INF\ + \ = 10 ** 18\n dp = [INF] * n\n for i in a:\n x = bisect_left(dp,\ + \ i)\n dp[x] = i\n\n return bisect_left(dp, INF)\n\nn = int(input())\n\ + a = list(map(int, input().split()))\n\ncnt = LIS(n, a)\nprint(cnt)" + dependsOn: [] + isVerificationFile: false + path: DP/LongestIncreasingSubsequence.py + requiredBy: [] + timestamp: '2022-05-22 23:05:29+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: DP/LongestIncreasingSubsequence.py +layout: document +redirect_from: +- /library/DP/LongestIncreasingSubsequence.py +- /library/DP/LongestIncreasingSubsequence.py.html +title: DP/LongestIncreasingSubsequence.py +--- diff --git a/DP/SlideMaxAlgorithm.py b/DP/SlideMaxAlgorithm.py deleted file mode 100644 index b14b440..0000000 --- a/DP/SlideMaxAlgorithm.py +++ /dev/null @@ -1,34 +0,0 @@ -# むずい -from collections import deque - -def SlideMinAlgorithm(a: list, k: int) -> list: - n = len(a) - ans = [-1] * (n - k + 1) - q = deque() - q.append((a[0], 0)) - for i in range(1, k): - if q[0][0] < a[i]: - q.appendleft((a[i], i)) - ans[0] = q[0][0] - - for i in range(1, n - k + 1): - if q[0][1] < i: - q.popleft() - while q: - if q[-1][0] >= a[i + k - 1]: - q.pop() - else: - break - q.append((a[i + k - 1], i + k - 1)) - ans[i] = q[0][0] - - return ans - - -def main() -> None: - a = [3, 1, 4, 1, 5, 9, 2, 6, 5] - print(SlideMinAlgorithm(a, 4)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/DP/SlideMaxAlgorithm.py.md b/DP/SlideMaxAlgorithm.py.md new file mode 100644 index 0000000..fe2274e --- /dev/null +++ b/DP/SlideMaxAlgorithm.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u3080\u305A\u3044\nfrom collections import deque\n\ndef SlideMinAlgorithm(a:\ + \ list, k: int) -> list:\n n = len(a)\n ans = [-1] * (n - k + 1)\n q\ + \ = deque()\n q.append((a[0], 0))\n for i in range(1, k):\n if q[0][0]\ + \ < a[i]:\n q.appendleft((a[i], i))\n ans[0] = q[0][0]\n\n for\ + \ i in range(1, n - k + 1):\n if q[0][1] < i:\n q.popleft()\n\ + \ while q:\n if q[-1][0] >= a[i + k - 1]:\n q.pop()\n\ + \ else:\n break\n q.append((a[i + k - 1], i +\ + \ k - 1))\n ans[i] = q[0][0]\n\n return ans\n\n\ndef main() -> None:\n\ + \ a = [3, 1, 4, 1, 5, 9, 2, 6, 5]\n print(SlideMinAlgorithm(a, 4))\n\n\n\ + if __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: DP/SlideMaxAlgorithm.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: DP/SlideMaxAlgorithm.py +layout: document +redirect_from: +- /library/DP/SlideMaxAlgorithm.py +- /library/DP/SlideMaxAlgorithm.py.html +title: DP/SlideMaxAlgorithm.py +--- diff --git a/DP/SlideMinAlgorithm.py b/DP/SlideMinAlgorithm.py deleted file mode 100644 index b6d7a65..0000000 --- a/DP/SlideMinAlgorithm.py +++ /dev/null @@ -1,33 +0,0 @@ -from collections import deque - -def SlideMinAlgorithm(a: list, k: int) -> list: - n = len(a) - ans = [-1] * (n - k + 1) - q = deque() - q.append((a[k - 1], k - 1)) - for i in reversed(range(k - 1)): - if q[0][0] < a[i]: - q.appendleft((a[i], i)) - ans[0] = q[0][0] - - for i in range(1, n - k + 1): - if q[0][1] < i: - q.popleft() - while q: - if q[-1][0] <= a[i + k - 1]: - q.pop() - else: - break - q.append((a[i + k - 1], i + k - 1)) - ans[i] = q[0][0] - - return ans - - -def main() -> None: - a = [3, 1, 4, 1, 5, 9, 2, 6, 5] - print(SlideMinAlgorithm(a, 4)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/DP/SlideMinAlgorithm.py.md b/DP/SlideMinAlgorithm.py.md new file mode 100644 index 0000000..bb81d33 --- /dev/null +++ b/DP/SlideMinAlgorithm.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from collections import deque\n\ndef SlideMinAlgorithm(a: list, k: int) ->\ + \ list:\n n = len(a)\n ans = [-1] * (n - k + 1)\n q = deque()\n q.append((a[k\ + \ - 1], k - 1))\n for i in reversed(range(k - 1)):\n if q[0][0] < a[i]:\n\ + \ q.appendleft((a[i], i))\n ans[0] = q[0][0]\n\n for i in range(1,\ + \ n - k + 1):\n if q[0][1] < i:\n q.popleft()\n while\ + \ q:\n if q[-1][0] <= a[i + k - 1]:\n q.pop()\n \ + \ else:\n break\n q.append((a[i + k - 1], i + k -\ + \ 1))\n ans[i] = q[0][0]\n\n return ans\n\n\ndef main() -> None:\n \ + \ a = [3, 1, 4, 1, 5, 9, 2, 6, 5]\n print(SlideMinAlgorithm(a, 4))\n\n\n\ + if __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: DP/SlideMinAlgorithm.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: DP/SlideMinAlgorithm.py +layout: document +redirect_from: +- /library/DP/SlideMinAlgorithm.py +- /library/DP/SlideMinAlgorithm.py.html +title: DP/SlideMinAlgorithm.py +--- diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7434b39 --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source "https://rubygems.org" +gem 'github-pages', group: :jekyll_plugins diff --git a/Geometry/RotateLeft.py b/Geometry/RotateLeft.py deleted file mode 100644 index 2e30ae5..0000000 --- a/Geometry/RotateLeft.py +++ /dev/null @@ -1,12 +0,0 @@ -def LeftRotate(l: list) -> list: - """左に90°回転させる""" - h, w = len(l), len(l[0]) - ans = [[None] * h for _ in range(w)] - for i in range(h): - for j in range(w): - ans[w - j - 1][i] = l[i][j] - - return ans - -sample = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] -print(*LeftRotate(sample), sep="\n") \ No newline at end of file diff --git a/Geometry/RotateLeft.py.md b/Geometry/RotateLeft.py.md new file mode 100644 index 0000000..ba530f7 --- /dev/null +++ b/Geometry/RotateLeft.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def LeftRotate(l: list) -> list:\n \"\"\"\u5DE6\u306B90\xB0\u56DE\u8EE2\ + \u3055\u305B\u308B\"\"\"\n h, w = len(l), len(l[0])\n ans = [[None] * h\ + \ for _ in range(w)]\n for i in range(h):\n for j in range(w):\n \ + \ ans[w - j - 1][i] = l[i][j]\n\n return ans\n\nsample = [[0, 1, 2,\ + \ 3], [4, 5, 6, 7], [8, 9, 10, 11]]\nprint(*LeftRotate(sample), sep=\"\\n\")" + dependsOn: [] + isVerificationFile: false + path: Geometry/RotateLeft.py + requiredBy: [] + timestamp: '2022-07-10 23:02:52+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Geometry/RotateLeft.py +layout: document +redirect_from: +- /library/Geometry/RotateLeft.py +- /library/Geometry/RotateLeft.py.html +title: Geometry/RotateLeft.py +--- diff --git a/Geometry/RotateReverse.py b/Geometry/RotateReverse.py deleted file mode 100644 index 4f3086a..0000000 --- a/Geometry/RotateReverse.py +++ /dev/null @@ -1,12 +0,0 @@ -def ReverseRotate(l: list) -> list: - """180°回転させる""" - h, w = len(l), len(l[0]) - ans = [[None] * w for _ in range(h)] - for i in range(h): - for j in range(w): - ans[h - i - 1][w - j - 1] = l[i][j] - - return ans - -sample = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] -print(*ReverseRotate(sample), sep="\n") \ No newline at end of file diff --git a/Geometry/RotateReverse.py.md b/Geometry/RotateReverse.py.md new file mode 100644 index 0000000..57c17dc --- /dev/null +++ b/Geometry/RotateReverse.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def ReverseRotate(l: list) -> list:\n \"\"\"180\xB0\u56DE\u8EE2\u3055\u305B\ + \u308B\"\"\"\n h, w = len(l), len(l[0])\n ans = [[None] * w for _ in range(h)]\n\ + \ for i in range(h):\n for j in range(w):\n ans[h - i - 1][w\ + \ - j - 1] = l[i][j]\n\n return ans\n\nsample = [[0, 1, 2, 3], [4, 5, 6, 7],\ + \ [8, 9, 10, 11]]\nprint(*ReverseRotate(sample), sep=\"\\n\")" + dependsOn: [] + isVerificationFile: false + path: Geometry/RotateReverse.py + requiredBy: [] + timestamp: '2022-07-10 23:02:52+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Geometry/RotateReverse.py +layout: document +redirect_from: +- /library/Geometry/RotateReverse.py +- /library/Geometry/RotateReverse.py.html +title: Geometry/RotateReverse.py +--- diff --git a/Geometry/RotateRight.py b/Geometry/RotateRight.py deleted file mode 100644 index 5d7e214..0000000 --- a/Geometry/RotateRight.py +++ /dev/null @@ -1,12 +0,0 @@ -def RightRotate(l: list) -> list: - """右に90°回転させる""" - h, w = len(l), len(l[0]) - ans = [[None] * h for _ in range(w)] - for i in range(h): - for j in range(w): - ans[j][h - i - 1] = l[i][j] - - return ans - -sample = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] -print(*RightRotate(sample), sep="\n") \ No newline at end of file diff --git a/Geometry/RotateRight.py.md b/Geometry/RotateRight.py.md new file mode 100644 index 0000000..610a383 --- /dev/null +++ b/Geometry/RotateRight.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def RightRotate(l: list) -> list:\n \"\"\"\u53F3\u306B90\xB0\u56DE\u8EE2\ + \u3055\u305B\u308B\"\"\"\n h, w = len(l), len(l[0])\n ans = [[None] * h\ + \ for _ in range(w)]\n for i in range(h):\n for j in range(w):\n \ + \ ans[j][h - i - 1] = l[i][j]\n\n return ans\n\nsample = [[0, 1, 2,\ + \ 3], [4, 5, 6, 7], [8, 9, 10, 11]]\nprint(*RightRotate(sample), sep=\"\\n\")" + dependsOn: [] + isVerificationFile: false + path: Geometry/RotateRight.py + requiredBy: [] + timestamp: '2022-07-10 23:02:52+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Geometry/RotateRight.py +layout: document +redirect_from: +- /library/Geometry/RotateRight.py +- /library/Geometry/RotateRight.py.html +title: Geometry/RotateRight.py +--- diff --git a/Geometry/RotateTranspose.py b/Geometry/RotateTranspose.py deleted file mode 100644 index 7ebec99..0000000 --- a/Geometry/RotateTranspose.py +++ /dev/null @@ -1,12 +0,0 @@ -def TransposeRotate(l: list) -> list: - """転置行列を求める""" - h, w = len(l), len(l[0]) - ans = [[None] * h for _ in range(w)] - for i in range(w): - for j in range(h): - ans[i][j] = l[j][i] - - return ans - -sample = [[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11]] -print(*TransposeRotate(sample), sep="\n") \ No newline at end of file diff --git a/Geometry/RotateTranspose.py.md b/Geometry/RotateTranspose.py.md new file mode 100644 index 0000000..4871bf1 --- /dev/null +++ b/Geometry/RotateTranspose.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def TransposeRotate(l: list) -> list:\n \"\"\"\u8EE2\u7F6E\u884C\u5217\ + \u3092\u6C42\u3081\u308B\"\"\"\n h, w = len(l), len(l[0])\n ans = [[None]\ + \ * h for _ in range(w)]\n for i in range(w):\n for j in range(h):\n\ + \ ans[i][j] = l[j][i]\n\n return ans\n\nsample = [[0, 1, 2, 3],\ + \ [4, 5, 6, 7], [8, 9, 10, 11]]\nprint(*TransposeRotate(sample), sep=\"\\n\")" + dependsOn: [] + isVerificationFile: false + path: Geometry/RotateTranspose.py + requiredBy: [] + timestamp: '2022-07-10 23:02:52+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Geometry/RotateTranspose.py +layout: document +redirect_from: +- /library/Geometry/RotateTranspose.py +- /library/Geometry/RotateTranspose.py.html +title: Geometry/RotateTranspose.py +--- diff --git a/Geometry/SharedPoint.py b/Geometry/SharedPoint.py deleted file mode 100644 index c5b85e4..0000000 --- a/Geometry/SharedPoint.py +++ /dev/null @@ -1,22 +0,0 @@ -def SharedPoint(x1: int, y1: int, r1: int, x2: int, y2: int, r2: int) -> int: - """2つの円の共有点の個数を求める""" - # (x1, y1) を中心とした半径 r1 の円 - # (x - x1) ** 2 + (y - y1) ** 2 = r1 ** 2 - d = (x1 - x2) ** 2 + (y1 - y2) ** 2 - - # r1 > r2 - if r1 < r2: - r1, r2 = r2, r1 - - if d == (r1 + r2) ** 2 or d == (r1 - r2) ** 2: - return 1 - elif (r1 - r2) ** 2 < d < (r1 + r2) ** 2: - return 2 - else: - return 0 - -''' -類題 -ABC259-D - Circumferences: https://atcoder.jp/contests/abc259/tasks/abc259_d -ACコード: https://atcoder.jp/contests/abc259/submissions/33150317 -''' diff --git a/Geometry/SharedPoint.py.md b/Geometry/SharedPoint.py.md new file mode 100644 index 0000000..c90293b --- /dev/null +++ b/Geometry/SharedPoint.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: + - https://atcoder.jp/contests/abc259/submissions/33150317 + - https://atcoder.jp/contests/abc259/tasks/abc259_d + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def SharedPoint(x1: int, y1: int, r1: int, x2: int, y2: int, r2: int) ->\ + \ int:\n \"\"\"2\u3064\u306E\u5186\u306E\u5171\u6709\u70B9\u306E\u500B\u6570\ + \u3092\u6C42\u3081\u308B\"\"\"\n # (x1, y1) \u3092\u4E2D\u5FC3\u3068\u3057\u305F\ + \u534A\u5F84 r1 \u306E\u5186\n # (x - x1) ** 2 + (y - y1) ** 2 = r1 ** 2\n\ + \ d = (x1 - x2) ** 2 + (y1 - y2) ** 2\n \n # r1 > r2\n if r1 < r2:\n\ + \ r1, r2 = r2, r1\n \n if d == (r1 + r2) ** 2 or d == (r1 - r2) **\ + \ 2:\n return 1\n elif (r1 - r2) ** 2 < d < (r1 + r2) ** 2:\n \ + \ return 2\n else:\n return 0\n\n'''\n\u985E\u984C\nABC259-D - Circumferences:\ + \ https://atcoder.jp/contests/abc259/tasks/abc259_d\nAC\u30B3\u30FC\u30C9: https://atcoder.jp/contests/abc259/submissions/33150317\n\ + '''\n" + dependsOn: [] + isVerificationFile: false + path: Geometry/SharedPoint.py + requiredBy: [] + timestamp: '2022-07-10 23:21:24+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Geometry/SharedPoint.py +layout: document +redirect_from: +- /library/Geometry/SharedPoint.py +- /library/Geometry/SharedPoint.py.html +title: Geometry/SharedPoint.py +--- diff --git a/Graph/BellmanFord.py b/Graph/BellmanFord.py deleted file mode 100644 index 7c485e0..0000000 --- a/Graph/BellmanFord.py +++ /dev/null @@ -1,43 +0,0 @@ -# 計算量:O(|V||E|) -def bellman_ford(n: int, g: list, s: int) -> list: - INF = float('inf') - dist = [INF] * n - dist[s] = 0 - - for i in range(n): - update = False # 経路更新を行ったか - for a, b, cost in g: - if dist[b] > dist[a] + cost: - dist[b] = dist[a] + cost - update = True - - # 更新が行われなければそれが最短経路となる - if not update: - break - - if i == n - 1: - return -1 - - return dist - - -def main() -> None: - n, m = map(int, input().split()) - g = [] - for _ in range(m): - u, v, cost = map(int, input().split()) - u -= 1 - v -= 1 - g.append((u, v, cost)) - g.append((v, u, cost)) - - ans = bellman_ford(0) - - if ans == -1: - print('Yes') - else: - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Graph/BellmanFord.py.md b/Graph/BellmanFord.py.md new file mode 100644 index 0000000..3ba6717 --- /dev/null +++ b/Graph/BellmanFord.py.md @@ -0,0 +1,44 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u8A08\u7B97\u91CF\uFF1AO(|V||E|)\ndef bellman_ford(n: int, g: list, s:\ + \ int) -> list:\n INF = float('inf')\n dist = [INF] * n\n dist[s] = 0\n\ + \n for i in range(n):\n update = False # \u7D4C\u8DEF\u66F4\u65B0\u3092\ + \u884C\u3063\u305F\u304B\n for a, b, cost in g:\n if dist[b]\ + \ > dist[a] + cost:\n dist[b] = dist[a] + cost\n \ + \ update = True\n\n # \u66F4\u65B0\u304C\u884C\u308F\u308C\u306A\u3051\ + \u308C\u3070\u305D\u308C\u304C\u6700\u77ED\u7D4C\u8DEF\u3068\u306A\u308B\n \ + \ if not update:\n break\n\n if i == n - 1:\n \ + \ return -1\n\n return dist\n\n\ndef main() -> None:\n n, m = map(int,\ + \ input().split())\n g = []\n for _ in range(m):\n u, v, cost = map(int,\ + \ input().split())\n u -= 1\n v -= 1\n g.append((u, v, cost))\n\ + \ g.append((v, u, cost))\n\n ans = bellman_ford(0)\n\n if ans ==\ + \ -1:\n print('Yes')\n else:\n print(ans)\n\n\nif __name__ ==\ + \ \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Graph/BellmanFord.py + requiredBy: [] + timestamp: '2022-07-19 12:08:25+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/BellmanFord.py +layout: document +redirect_from: +- /library/Graph/BellmanFord.py +- /library/Graph/BellmanFord.py.html +title: Graph/BellmanFord.py +--- diff --git a/Graph/Dijkstra.py b/Graph/Dijkstra.py deleted file mode 100644 index 374144e..0000000 --- a/Graph/Dijkstra.py +++ /dev/null @@ -1,32 +0,0 @@ -from heapq import heappush, heappop - -def dijkstra(s: int, g: list, INF=10**18) -> list: - n = len(g) - dist = [INF] * n - dist[s] = 0 - q = [(0, s)] - while q: - pre = heappop(q)[1] - for nxt, cost in g[pre]: - if dist[nxt] < dist[pre] + cost: continue - dist[nxt] = dist[pre] + cost - heappush(q, (dist[nxt], nxt)) - - return dist - - -def main(): - n, m = map(int,input().split()) - g = [[] for _ in range(n)] - for _ in range(m): - x, y, cost = map(int,input().split()) - x -= 1 - y -= 1 - g[x].append((y, cost)) - g[y].append((x, cost)) - - d = dijkstra(0, g) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Graph/Dijkstra.py.md b/Graph/Dijkstra.py.md new file mode 100644 index 0000000..7710c58 --- /dev/null +++ b/Graph/Dijkstra.py.md @@ -0,0 +1,39 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from heapq import heappush, heappop\n\ndef dijkstra(s: int, g: list, INF=10**18)\ + \ -> list:\n n = len(g)\n dist = [INF] * n\n dist[s] = 0\n q = [(0,\ + \ s)]\n while q:\n pre = heappop(q)[1]\n for nxt, cost in g[pre]:\n\ + \ if dist[nxt] < dist[pre] + cost: continue\n dist[nxt]\ + \ = dist[pre] + cost\n heappush(q, (dist[nxt], nxt))\n\n return\ + \ dist\n\n\ndef main():\n n, m = map(int,input().split())\n g = [[] for\ + \ _ in range(n)]\n for _ in range(m):\n x, y, cost = map(int,input().split())\n\ + \ x -= 1\n y -= 1\n g[x].append((y, cost))\n g[y].append((x,\ + \ cost))\n\n d = dijkstra(0, g)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Graph/Dijkstra.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/Dijkstra.py +layout: document +redirect_from: +- /library/Graph/Dijkstra.py +- /library/Graph/Dijkstra.py.html +title: Graph/Dijkstra.py +--- diff --git a/Graph/EulerTour.py b/Graph/EulerTour.py deleted file mode 100644 index 1cb8e21..0000000 --- a/Graph/EulerTour.py +++ /dev/null @@ -1,30 +0,0 @@ -import sys -sys.setrecursionlimit(10 ** 6) - -n = int(input()) -g = [[] for _ in range(n)] - -for _ in range(n - 1): - a, b = map(int,input().split()) - a -= 1 - b -= 1 - g[a].append(b) - g[b].append(a) - -for i in range(n): - g[i].sort() - -ans = [] # 頂点集合 -depth = [] # 深さの集合 -def dfs(now: int, prev: int, cnt: int): - ans.append(now + 1) - depth.append(cnt) - for nxt in g[now]: - if nxt == prev: continue - dfs(nxt, now, cnt + 1) - ans.append(now + 1) - depth.append(cnt) - -dfs(0, -1, 0) -print(*ans) -print(*depth) \ No newline at end of file diff --git a/Graph/EulerTour.py.md b/Graph/EulerTour.py.md new file mode 100644 index 0000000..5ea2884 --- /dev/null +++ b/Graph/EulerTour.py.md @@ -0,0 +1,38 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\nsys.setrecursionlimit(10 ** 6)\n\nn = int(input())\ng = [[] for\ + \ _ in range(n)]\n\nfor _ in range(n - 1):\n a, b = map(int,input().split())\n\ + \ a -= 1\n b -= 1\n g[a].append(b)\n g[b].append(a)\n\nfor i in range(n):\n\ + \ g[i].sort()\n\nans = [] # \u9802\u70B9\u96C6\u5408\ndepth = [] # \u6DF1\u3055\ + \u306E\u96C6\u5408\ndef dfs(now: int, prev: int, cnt: int):\n ans.append(now\ + \ + 1)\n depth.append(cnt)\n for nxt in g[now]:\n if nxt == prev:\ + \ continue\n dfs(nxt, now, cnt + 1)\n ans.append(now + 1)\n \ + \ depth.append(cnt)\n\ndfs(0, -1, 0)\nprint(*ans)\nprint(*depth)" + dependsOn: [] + isVerificationFile: false + path: Graph/EulerTour.py + requiredBy: [] + timestamp: '2022-02-06 18:58:27+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/EulerTour.py +layout: document +redirect_from: +- /library/Graph/EulerTour.py +- /library/Graph/EulerTour.py.html +title: Graph/EulerTour.py +--- diff --git a/Graph/Kruskal.py b/Graph/Kruskal.py deleted file mode 100644 index a380a7a..0000000 --- a/Graph/Kruskal.py +++ /dev/null @@ -1,59 +0,0 @@ -class Kruskal: - def __init__(self, n: int, g: list) -> None: - self.n = n - self.g = g.sort(key=lambda x: x[2]) - self.p = [-1] * n - - - def leader(self, a: int) -> int: - while self.p[a] >= 0: - a = self.p[a] - - return a - - - def merge(self, a: int, b: int) -> int: - x = self.leader(a) - y = self.leader(b) - - if x == y: - return x - - if self.p[x] > self.p[y]: - x, y = y, x - - self.p[x] += self.p[y] - self.p[y] = x - - return x - - - def same(self, a: int, b: int) -> bool: - return self.leader(a) == self.leader(b) - - - def size(self, a: int) -> int: - return -self.p[self.leader(a)] - - - def cost(self, g: list) -> list: - tree = [] - for u, v, cost in g: - if self.same(u, v): - continue - self.merge(u, v) - tree.append(cost) - - return tree - - -def main() -> None: - n, m = map(int, input().split()) - g = [list(map(int, input().split())) for _ in range(m)] - - kruskal = Kruskal(n, g) - print(sum(kruskal.tree(g))) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Graph/Kruskal.py.md b/Graph/Kruskal.py.md new file mode 100644 index 0000000..a40bb6b --- /dev/null +++ b/Graph/Kruskal.py.md @@ -0,0 +1,50 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1639.test.py + title: Test/yukicoder/1639.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "class Kruskal:\n def __init__(self, n: int, g: list) -> None:\n \ + \ self.n = n\n self.g = g.sort(key=lambda x: x[2])\n self.p = [-1]\ + \ * n\n\n\n def leader(self, a: int) -> int:\n while self.p[a] >= 0:\n\ + \ a = self.p[a]\n\n return a\n\n\n def merge(self, a: int,\ + \ b: int) -> int:\n x = self.leader(a)\n y = self.leader(b)\n\n\ + \ if x == y:\n return x\n\n if self.p[x] > self.p[y]:\n\ + \ x, y = y, x\n\n self.p[x] += self.p[y]\n self.p[y]\ + \ = x\n\n return x\n\n\n def same(self, a: int, b: int) -> bool:\n \ + \ return self.leader(a) == self.leader(b)\n\n\n def size(self, a: int)\ + \ -> int:\n return -self.p[self.leader(a)]\n\n\n def cost(self, g: list)\ + \ -> list:\n tree = []\n for u, v, cost in g:\n if self.same(u,\ + \ v):\n continue\n self.merge(u, v)\n tree.append(cost)\n\ + \n return tree\n\n\ndef main() -> None:\n n, m = map(int, input().split())\n\ + \ g = [list(map(int, input().split())) for _ in range(m)]\n\n kruskal =\ + \ Kruskal(n, g)\n print(sum(kruskal.tree(g)))\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: false + path: Graph/Kruskal.py + requiredBy: [] + timestamp: '2022-08-10 23:47:40+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/yukicoder/1639.test.py +documentation_of: Graph/Kruskal.py +layout: document +redirect_from: +- /library/Graph/Kruskal.py +- /library/Graph/Kruskal.py.html +title: Graph/Kruskal.py +--- diff --git a/Graph/LowestCommonAncestor.py b/Graph/LowestCommonAncestor.py deleted file mode 100644 index bbb3725..0000000 --- a/Graph/LowestCommonAncestor.py +++ /dev/null @@ -1,53 +0,0 @@ -import sys -sys.setrecursionlimit(10 ** 6) - -n = int(input()) -g = [[] for _ in range(n)] -for i in range(n): - a = list(map(int, input().split()))[1:] - for j in a: - g[i].append(j) - g[j].append(i) - -LogN = 1 -while 1 << LogN < n: - LogN += 1 - -depth = [0] * n -root = [[0] * n for _ in range(LogN)] - -def dfs(now: int, prev: int): - root[0][now] = prev - for nxt in g[now]: - if nxt == prev: continue - depth[nxt] = depth[now] + 1 - dfs(nxt, now) -dfs(0, -1) - -for i in range(LogN - 1): - for j in range(n): - root[i + 1][j] = root[i][root[i][j]] - -def LCA(u, v): - # depth[u] < depth[v] - if depth[u] > depth[v]: - u, v = v, u - - dist = depth[v] - depth[u] - for i in range(LogN): - if dist >> i & 1: - v = root[i][v] - - if u == v: - return u - - for i in reversed(range(LogN)): - if root[i][u] != root[i][v]: - u = root[i][u] - v = root[i][v] - return root[0][u] - -q = int(input()) -for _ in range(q): - u, v = map(int, input().split()) - print(LCA(u, v)) \ No newline at end of file diff --git a/Graph/LowestCommonAncestor.py.md b/Graph/LowestCommonAncestor.py.md new file mode 100644 index 0000000..96211f4 --- /dev/null +++ b/Graph/LowestCommonAncestor.py.md @@ -0,0 +1,45 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\nsys.setrecursionlimit(10 ** 6)\n\nn = int(input())\ng = [[] for\ + \ _ in range(n)]\nfor i in range(n):\n a = list(map(int, input().split()))[1:]\n\ + \ for j in a:\n g[i].append(j)\n g[j].append(i)\n\nLogN = 1\n\ + while 1 << LogN < n: \n LogN += 1\n\ndepth = [0] * n\nroot = [[0] * n for _\ + \ in range(LogN)]\n\ndef dfs(now: int, prev: int):\n root[0][now] = prev\n\ + \ for nxt in g[now]:\n if nxt == prev: continue\n depth[nxt]\ + \ = depth[now] + 1\n dfs(nxt, now)\ndfs(0, -1)\n\nfor i in range(LogN -\ + \ 1):\n for j in range(n):\n root[i + 1][j] = root[i][root[i][j]]\n\n\ + def LCA(u, v):\n # depth[u] < depth[v]\n if depth[u] > depth[v]:\n \ + \ u, v = v, u\n\n dist = depth[v] - depth[u]\n for i in range(LogN):\n\ + \ if dist >> i & 1:\n v = root[i][v]\n\n if u == v:\n \ + \ return u\n\n for i in reversed(range(LogN)):\n if root[i][u] !=\ + \ root[i][v]:\n u = root[i][u]\n v = root[i][v]\n return\ + \ root[0][u]\n\nq = int(input())\nfor _ in range(q):\n u, v = map(int, input().split())\n\ + \ print(LCA(u, v))" + dependsOn: [] + isVerificationFile: false + path: Graph/LowestCommonAncestor.py + requiredBy: [] + timestamp: '2022-02-06 19:12:47+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/LowestCommonAncestor.py +layout: document +redirect_from: +- /library/Graph/LowestCommonAncestor.py +- /library/Graph/LowestCommonAncestor.py.html +title: Graph/LowestCommonAncestor.py +--- diff --git a/Graph/Prim.py b/Graph/Prim.py deleted file mode 100644 index e738946..0000000 --- a/Graph/Prim.py +++ /dev/null @@ -1,33 +0,0 @@ -# 最小全域木(プリム法) -from heapq import heappop, heappush, heapify - -n, m = map(int,input().split()) - -g = [[] for _ in range(n)] -for _ in range(m): - u, v, cost = map(int,input().split()) - g[u].append((cost, v)) - g[v].append((cost, u)) - -visited = [False] * n -connection = 0 -q = [] -q.append((0, 0)) -heapify(q) - -ans = 0 -while q: - cost, v = heappop(q) - if visited[v]: continue - - visited[v] = True - connection += 1 - ans += cost - - for nxt in g[v]: - heappush(q, nxt) - - if connection == n: - break - -print(ans) \ No newline at end of file diff --git a/Graph/Prim.py.md b/Graph/Prim.py.md new file mode 100644 index 0000000..46a9dec --- /dev/null +++ b/Graph/Prim.py.md @@ -0,0 +1,38 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u6700\u5C0F\u5168\u57DF\u6728\uFF08\u30D7\u30EA\u30E0\u6CD5\uFF09\nfrom\ + \ heapq import heappop, heappush, heapify\n\nn, m = map(int,input().split())\n\ + \ng = [[] for _ in range(n)]\nfor _ in range(m):\n u, v, cost = map(int,input().split())\n\ + \ g[u].append((cost, v))\n g[v].append((cost, u))\n\nvisited = [False] *\ + \ n\nconnection = 0\nq = []\nq.append((0, 0))\nheapify(q)\n\nans = 0\nwhile q:\n\ + \ cost, v = heappop(q)\n if visited[v]: continue\n\n visited[v] = True\n\ + \ connection += 1\n ans += cost\n\n for nxt in g[v]:\n heappush(q,\ + \ nxt)\n \n if connection == n:\n break\n\nprint(ans)" + dependsOn: [] + isVerificationFile: false + path: Graph/Prim.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/Prim.py +layout: document +redirect_from: +- /library/Graph/Prim.py +- /library/Graph/Prim.py.html +title: Graph/Prim.py +--- diff --git a/Graph/StronglyConnectedComponent.py b/Graph/StronglyConnectedComponent.py deleted file mode 100644 index 259bd30..0000000 --- a/Graph/StronglyConnectedComponent.py +++ /dev/null @@ -1,78 +0,0 @@ -import sys -input = sys.stdin.readline - -"SCC(Strongly Connected Component) := 強連結成分分解" -class SCC: - def __init__(self, n): - self.n = n - self.graph = [[] for _ in range(n)] - self.rev_graph = [[] for _ in range(n)] - self.labels = [-1] * n - self.lb_cnt = 0 - - def add_edge(self, v, nxt_v): - self.graph[v].append(nxt_v) - self.rev_graph[nxt_v].append(v) - - def build(self): - self.post_order = [] - self.used = [False] * self.n - for v in range(self.n): - if not self.used[v]: - self._dfs(v) - for v in reversed(self.post_order): - if self.labels[v] == -1: - self._rev_dfs(v) - self.lb_cnt += 1 - - def _dfs(self, v): - stack = [v, 0] - while stack: - v, idx = stack[-2:] - if not idx and self.used[v]: - stack.pop() - stack.pop() - else: - self.used[v] = True - if idx < len(self.graph[v]): - stack[-1] += 1 - stack.append(self.graph[v][idx]) - stack.append(0) - else: - stack.pop() - self.post_order.append(stack.pop()) - - def _rev_dfs(self, v): - stack = [v] - self.labels[v] = self.lb_cnt - while stack: - v = stack.pop() - for nxt_v in self.rev_graph[v]: - if self.labels[nxt_v] != -1: - continue - stack.append(nxt_v) - self.labels[nxt_v] = self.lb_cnt - - def construct(self): - self.dag = [[] for i in range(self.lb_cnt)] - self.groups = [[] for i in range(self.lb_cnt)] - for v, lb in enumerate(self.labels): - for nxt_v in self.graph[v]: - nxt_lb = self.labels[nxt_v] - if lb == nxt_lb: - continue - self.dag[lb].append(nxt_lb) - self.groups[lb].append(v) - return self.dag, self.groups - - -n, m = map(int, input().split()) # ノード数・エッジ数 -graph = [list(map(int,input().split())) for _ in range(m)] # エッジの受け取り -scc = SCC(n) # Classを使えるようにする - -for u, v in graph: - scc.add_edge(u - 1, v - 1) # 有向グラフにする(0index) -scc.build() -_,elems = scc.construct() # 閉路ずつの配列で帰ってくる - -print(elems) \ No newline at end of file diff --git a/Graph/StronglyConnectedComponent.py.md b/Graph/StronglyConnectedComponent.py.md new file mode 100644 index 0000000..ccb932a --- /dev/null +++ b/Graph/StronglyConnectedComponent.py.md @@ -0,0 +1,64 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\ninput = sys.stdin.readline\n\n\"SCC\uFF08Strongly Connected Component\uFF09\ + \ := \u5F37\u9023\u7D50\u6210\u5206\u5206\u89E3\"\nclass SCC:\n def __init__(self,\ + \ n):\n self.n = n\n self.graph = [[] for _ in range(n)]\n \ + \ self.rev_graph = [[] for _ in range(n)]\n self.labels = [-1] * n\n\ + \ self.lb_cnt = 0\n\n def add_edge(self, v, nxt_v):\n self.graph[v].append(nxt_v)\n\ + \ self.rev_graph[nxt_v].append(v)\n\n def build(self):\n self.post_order\ + \ = []\n self.used = [False] * self.n\n for v in range(self.n):\n\ + \ if not self.used[v]:\n self._dfs(v)\n for v\ + \ in reversed(self.post_order):\n if self.labels[v] == -1:\n \ + \ self._rev_dfs(v)\n self.lb_cnt += 1\n\n def _dfs(self,\ + \ v):\n stack = [v, 0]\n while stack:\n v, idx = stack[-2:]\n\ + \ if not idx and self.used[v]:\n stack.pop()\n \ + \ stack.pop()\n else:\n self.used[v] = True\n\ + \ if idx < len(self.graph[v]):\n stack[-1] +=\ + \ 1\n stack.append(self.graph[v][idx])\n \ + \ stack.append(0)\n else:\n stack.pop()\n \ + \ self.post_order.append(stack.pop())\n\n def _rev_dfs(self,\ + \ v):\n stack = [v]\n self.labels[v] = self.lb_cnt\n while\ + \ stack:\n v = stack.pop()\n for nxt_v in self.rev_graph[v]:\n\ + \ if self.labels[nxt_v] != -1:\n continue\n\ + \ stack.append(nxt_v)\n self.labels[nxt_v] = self.lb_cnt\n\ + \n def construct(self):\n self.dag = [[] for i in range(self.lb_cnt)]\n\ + \ self.groups = [[] for i in range(self.lb_cnt)]\n for v, lb in\ + \ enumerate(self.labels):\n for nxt_v in self.graph[v]:\n \ + \ nxt_lb = self.labels[nxt_v]\n if lb == nxt_lb:\n \ + \ continue\n self.dag[lb].append(nxt_lb)\n \ + \ self.groups[lb].append(v)\n return self.dag, self.groups\n\n\nn,\ + \ m = map(int, input().split()) # \u30CE\u30FC\u30C9\u6570\u30FB\u30A8\u30C3\u30B8\ + \u6570\ngraph = [list(map(int,input().split())) for _ in range(m)] # \u30A8\u30C3\ + \u30B8\u306E\u53D7\u3051\u53D6\u308A\nscc = SCC(n) # Class\u3092\u4F7F\u3048\u308B\ + \u3088\u3046\u306B\u3059\u308B\n\nfor u, v in graph:\n scc.add_edge(u - 1,\ + \ v - 1) # \u6709\u5411\u30B0\u30E9\u30D5\u306B\u3059\u308B\uFF080index\uFF09\n\ + scc.build()\n_,elems = scc.construct() # \u9589\u8DEF\u305A\u3064\u306E\u914D\u5217\ + \u3067\u5E30\u3063\u3066\u304F\u308B\n\nprint(elems)" + dependsOn: [] + isVerificationFile: false + path: Graph/StronglyConnectedComponent.py + requiredBy: [] + timestamp: '2022-02-06 19:12:47+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/StronglyConnectedComponent.py +layout: document +redirect_from: +- /library/Graph/StronglyConnectedComponent.py +- /library/Graph/StronglyConnectedComponent.py.html +title: Graph/StronglyConnectedComponent.py +--- diff --git a/Graph/TopologicalSort.py b/Graph/TopologicalSort.py deleted file mode 100644 index fc4518f..0000000 --- a/Graph/TopologicalSort.py +++ /dev/null @@ -1,34 +0,0 @@ -from collections import defaultdict -from heapq import heappop, heappush - -n, m = map(int,input().split()) - -g = [[] for _ in range(n)] -d = defaultdict(int) # d[i] := 頂点iに入ってくる辺の個数 - -for _ in range(m): - a, b = map(int,input().split()) - g[a - 1].append(b - 1) - d[b - 1] += 1 - -q = [] -# スタート地点を決める -for i in range(n): - if d[i] == 0: - heappush(q, i) - -ans = [] -l = 0 # 答えの長さ -while l < n: - if len(q) == 0: - exit(print(-1)) - - v = heappop(q) - ans.append(v + 1) - l += 1 - for i in g[v]: - d[i] -= 1 - if d[i] == 0: - heappush(q, i) - -print(*ans) \ No newline at end of file diff --git a/Graph/TopologicalSort.py.md b/Graph/TopologicalSort.py.md new file mode 100644 index 0000000..e9579f1 --- /dev/null +++ b/Graph/TopologicalSort.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from collections import defaultdict\nfrom heapq import heappop, heappush\n\ + \nn, m = map(int,input().split())\n\ng = [[] for _ in range(n)]\nd = defaultdict(int)\ + \ # d[i] := \u9802\u70B9i\u306B\u5165\u3063\u3066\u304F\u308B\u8FBA\u306E\u500B\ + \u6570\n\nfor _ in range(m):\n a, b = map(int,input().split())\n g[a - 1].append(b\ + \ - 1)\n d[b - 1] += 1\n\nq = []\n# \u30B9\u30BF\u30FC\u30C8\u5730\u70B9\u3092\ + \u6C7A\u3081\u308B\nfor i in range(n):\n if d[i] == 0:\n heappush(q,\ + \ i)\n\nans = []\nl = 0 # \u7B54\u3048\u306E\u9577\u3055\nwhile l < n:\n if\ + \ len(q) == 0:\n exit(print(-1))\n\n v = heappop(q)\n ans.append(v\ + \ + 1)\n l += 1\n for i in g[v]:\n d[i] -= 1\n if d[i] ==\ + \ 0:\n heappush(q, i)\n\nprint(*ans)" + dependsOn: [] + isVerificationFile: false + path: Graph/TopologicalSort.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/TopologicalSort.py +layout: document +redirect_from: +- /library/Graph/TopologicalSort.py +- /library/Graph/TopologicalSort.py.html +title: Graph/TopologicalSort.py +--- diff --git a/Graph/warshall_floyd.py b/Graph/warshall_floyd.py deleted file mode 100644 index 0c8cc92..0000000 --- a/Graph/warshall_floyd.py +++ /dev/null @@ -1,26 +0,0 @@ -# warshall_floyd法 -def warshall_floyd() -> list: - for k in range(n): - for i in range(n): - for j in range(n): - dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]) - - return dist - -INF = 10 ** 20 -n, m = map(int,input().split()) # 頂点数・辺の数 - -dist = [[INF] * n for _ in range(n)] # 隣接行列の初期化 - -# 自分自身へのコストは 0 -for i in range(n): - dist[i][i] = 0 - -# 与えられた距離の初期化 -for i in range(m): - x, y, r = map(int,input().split()) - dist[x - 1][y - 1] = r - dist[y - 1][x - 1] = r - -# sからtへの最短距離を求める -ans = warshall_floyd() \ No newline at end of file diff --git a/Graph/warshall_floyd.py.md b/Graph/warshall_floyd.py.md new file mode 100644 index 0000000..ba883d3 --- /dev/null +++ b/Graph/warshall_floyd.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# warshall_floyd\u6CD5\ndef warshall_floyd() -> list:\n for k in range(n):\n\ + \ for i in range(n):\n for j in range(n):\n dist[i][j]\ + \ = min(dist[i][j], dist[i][k] + dist[k][j])\n\n return dist\n\nINF = 10 **\ + \ 20\nn, m = map(int,input().split()) # \u9802\u70B9\u6570\u30FB\u8FBA\u306E\u6570\ + \n\ndist = [[INF] * n for _ in range(n)] # \u96A3\u63A5\u884C\u5217\u306E\u521D\ + \u671F\u5316\n\n# \u81EA\u5206\u81EA\u8EAB\u3078\u306E\u30B3\u30B9\u30C8\u306F\ + \ 0\nfor i in range(n):\n dist[i][i] = 0\n\n# \u4E0E\u3048\u3089\u308C\u305F\ + \u8DDD\u96E2\u306E\u521D\u671F\u5316\nfor i in range(m):\n x, y, r = map(int,input().split())\n\ + \ dist[x - 1][y - 1] = r\n dist[y - 1][x - 1] = r\n\n# s\u304B\u3089t\u3078\ + \u306E\u6700\u77ED\u8DDD\u96E2\u3092\u6C42\u3081\u308B\nans = warshall_floyd()" + dependsOn: [] + isVerificationFile: false + path: Graph/warshall_floyd.py + requiredBy: [] + timestamp: '2022-03-23 20:17:58+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Graph/warshall_floyd.py +layout: document +redirect_from: +- /library/Graph/warshall_floyd.py +- /library/Graph/warshall_floyd.py.html +title: Graph/warshall_floyd.py +--- diff --git a/Math/BinaryToDecimal.py b/Math/BinaryToDecimal.py deleted file mode 100644 index e1ea361..0000000 --- a/Math/BinaryToDecimal.py +++ /dev/null @@ -1,11 +0,0 @@ -# 2進数 -> 10進数への変換 -def BinaryToDecimal(num): - num = str(num)[::-1] - decimal_number = 0 - for i in range(len(num)): - decimal_number += int(num[i]) * (2 ** i) - return decimal_number - -n = 101001001111101011 -ans = BinaryToDecimal(n) -print(ans) \ No newline at end of file diff --git a/Math/BinaryToDecimal.py.md b/Math/BinaryToDecimal.py.md new file mode 100644 index 0000000..35a838e --- /dev/null +++ b/Math/BinaryToDecimal.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \uFF12\u9032\u6570 -> 10\u9032\u6570\u3078\u306E\u5909\u63DB\ndef BinaryToDecimal(num):\n\ + \ num = str(num)[::-1]\n decimal_number = 0\n for i in range(len(num)):\n\ + \ decimal_number += int(num[i]) * (2 ** i)\n return decimal_number\n\ + \nn = 101001001111101011\nans = BinaryToDecimal(n)\nprint(ans)" + dependsOn: [] + isVerificationFile: false + path: Math/BinaryToDecimal.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/BinaryToDecimal.py +layout: document +redirect_from: +- /library/Math/BinaryToDecimal.py +- /library/Math/BinaryToDecimal.py.html +title: Math/BinaryToDecimal.py +--- diff --git a/Math/Combination.py b/Math/Combination.py deleted file mode 100644 index 49bd318..0000000 --- a/Math/Combination.py +++ /dev/null @@ -1,31 +0,0 @@ -class Combination: - def __init__(self, N: int, MOD: int) -> None: - self.N = N + 100 - self.MOD = MOD - self.fac = [0]*(self.N + 1) - self.fac_inv = [0]*(self.N + 1) - self.fac[0] = 1 - self.fac_inv[0] = 1 - - for i in range(1, self.N + 1): - self.fac[i] = self.fac[i - 1] * i - self.fac[i] %= self.MOD - - for i in range(1, self.N + 1): - self.fac_inv[i] = pow(self.fac[i], self.MOD - 2, self.MOD) - - def nCr(self, N: int, R: int) -> int: - return self.fac[N]*self.fac_inv[R]*self.fac_inv[N - R] % self.MOD - - def nPr(self, N: int, R: int) -> int: - return self.nCr(N, R)*self.fac[R] % self.MOD - - -def main() -> None: - N = 10**5 - mod = 998244353 - Com = Combination(N, mod) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Math/Combination.py.md b/Math/Combination.py.md new file mode 100644 index 0000000..e96f607 --- /dev/null +++ b/Math/Combination.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "class Combination:\n def __init__(self, N: int, MOD: int) -> None:\n \ + \ self.N = N + 100\n self.MOD = MOD\n self.fac = [0]*(self.N\ + \ + 1)\n self.fac_inv = [0]*(self.N + 1)\n self.fac[0] = 1\n \ + \ self.fac_inv[0] = 1\n\n for i in range(1, self.N + 1):\n \ + \ self.fac[i] = self.fac[i - 1] * i\n self.fac[i] %= self.MOD\n\ + \ \n for i in range(1, self.N + 1):\n self.fac_inv[i]\ + \ = pow(self.fac[i], self.MOD - 2, self.MOD)\n \n def nCr(self, N: int,\ + \ R: int) -> int:\n return self.fac[N]*self.fac_inv[R]*self.fac_inv[N -\ + \ R] % self.MOD\n\n def nPr(self, N: int, R: int) -> int:\n return self.nCr(N,\ + \ R)*self.fac[R] % self.MOD\n\n\ndef main() -> None:\n N = 10**5\n mod =\ + \ 998244353\n Com = Combination(N, mod)\n\n\nif __name__ == \"__main__\":\n\ + \ main()" + dependsOn: [] + isVerificationFile: false + path: Math/Combination.py + requiredBy: [] + timestamp: '2024-08-21 21:59:55+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/Combination.py +layout: document +redirect_from: +- /library/Math/Combination.py +- /library/Math/Combination.py.html +title: Math/Combination.py +--- diff --git a/Math/CumulativeSum.py b/Math/CumulativeSum.py deleted file mode 100644 index f1c0753..0000000 --- a/Math/CumulativeSum.py +++ /dev/null @@ -1,10 +0,0 @@ -# 配列の累積和を求める -def CumulativeSum(num_array): - for i in range(len(num_array) - 1): - num_array[i + 1] += num_array[i] - return num_array - - -a = [1, 4, -1, 9, 34, 21, -12, 31] -ans = CumulativeSum(a) -print(ans) \ No newline at end of file diff --git a/Math/CumulativeSum.py.md b/Math/CumulativeSum.py.md new file mode 100644 index 0000000..cce6d3f --- /dev/null +++ b/Math/CumulativeSum.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u914D\u5217\u306E\u7D2F\u7A4D\u548C\u3092\u6C42\u3081\u308B\ndef CumulativeSum(num_array):\n\ + \ for i in range(len(num_array) - 1):\n num_array[i + 1] += num_array[i]\n\ + \ return num_array\n\n\na = [1, 4, -1, 9, 34, 21, -12, 31]\nans = CumulativeSum(a)\n\ + print(ans)" + dependsOn: [] + isVerificationFile: false + path: Math/CumulativeSum.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/CumulativeSum.py +layout: document +redirect_from: +- /library/Math/CumulativeSum.py +- /library/Math/CumulativeSum.py.html +title: Math/CumulativeSum.py +--- diff --git a/Math/DecimalToBinary.py b/Math/DecimalToBinary.py deleted file mode 100644 index 96b5e03..0000000 --- a/Math/DecimalToBinary.py +++ /dev/null @@ -1,11 +0,0 @@ -# 10進数 -> 2進数への変換 -def DeciamlToBinary(num): - binary_number = "" - while num > 0: - binary_number += str(num % 2) - num //= 2 - return int(binary_number[::-1]) - -n = 1234567890 -ans = DeciamlToBinary(n) -print(ans) \ No newline at end of file diff --git a/Math/DecimalToBinary.py.md b/Math/DecimalToBinary.py.md new file mode 100644 index 0000000..76a98f1 --- /dev/null +++ b/Math/DecimalToBinary.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# 10\u9032\u6570 -> 2\u9032\u6570\u3078\u306E\u5909\u63DB\ndef DeciamlToBinary(num):\n\ + \ binary_number = \"\"\n while num > 0:\n binary_number += str(num\ + \ % 2)\n num //= 2\n return int(binary_number[::-1])\n\nn = 1234567890\n\ + ans = DeciamlToBinary(n)\nprint(ans)" + dependsOn: [] + isVerificationFile: false + path: Math/DecimalToBinary.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/DecimalToBinary.py +layout: document +redirect_from: +- /library/Math/DecimalToBinary.py +- /library/Math/DecimalToBinary.py.html +title: Math/DecimalToBinary.py +--- diff --git a/Math/Dice.py b/Math/Dice.py deleted file mode 100644 index a8a92ec..0000000 --- a/Math/Dice.py +++ /dev/null @@ -1,64 +0,0 @@ -import sys - -class Dice: - """サイコロの全ての状態 (up, down, front, back, left, right の順) (u + d = f + b = l + r = 7 が成り立つ)""" - state = [ - [1, 6, 2, 5, 4, 3], [1, 6, 3, 4, 2, 5], [1, 6, 4, 3, 5, 2], [1, 6, 5, 2, 3, 4], - [2, 5, 1, 6, 3, 4], [2, 5, 3, 4, 6, 1], [2, 5, 4, 3, 1, 6], [2, 5, 6, 1, 4, 3], - [3, 4, 1, 6, 5, 2], [3, 4, 2, 5, 1, 6], [3, 4, 5, 2, 6, 1], [3, 4, 6, 1, 2, 5], - [4, 3, 1, 6, 2, 5], [4, 3, 2, 5, 6, 1], [4, 3, 5, 2, 1, 6], [4, 3, 6, 1, 5, 2], - [5, 2, 1, 6, 4, 3], [5, 2, 3, 4, 1, 6], [5, 2, 4, 3, 6, 1], [5, 2, 6, 1, 3, 4], - [6, 1, 2, 5, 3, 4], [6, 1, 3, 4, 5, 2], [6, 1, 4, 3, 2, 5], [6, 1, 5, 2, 4, 3] - ] - - def __init__(self, state1: int, value1: int, state2: int, value2: int, now_x: int, now_y: int) -> None: - """state1 の面が value1, state2 の面が value2""" - """u, d, f, b, l, r -> 0, 1, 2, 3, 4, 5""" - self.now_x = now_x - self.now_y = now_y - for i in range(24): - if Dice.state[i][state1] == value1 and Dice.state[i][state2] == value2: - self.u, self.d, self.f, self.b, self.l, self.r = Dice.state[i] - break - else: - print("Error", file=sys.stderr) - exit() - - - #上から見てy軸の+方向に回転 (後面が下面になる) - def RotateN(self) -> None: - self.d, self.f, self.u, self.b = self.b, self.d, self.f, self.u - self.now_y += 1 - - - #上から見てy軸の-方向に回転 (前面が下面になる) - def RotateS(self) -> None: - self.d, self.f, self.u ,self.b = self.f, self.u, self.b, self.d - self.now_y -= 1 - - - #上から見てx軸の+方向に回転 (右面が下面になる) - def RotateE(self) -> None: - self.d, self.l, self.u, self.r = self.r, self.d, self.l, self.u - self.now_x += 1 - - - # 上から見てx軸の-方向に回転 (左面が下面になる) - def RotateW(self) -> None: - self.d, self.l, self.u, self.r = self.l, self.u, self.r, self.d - self.now_x -= 1 - - - # 前から見て左回転 (反時計回り) - def RotateL(self) -> None: - self.f, self.l, self.b, self.r = self.r, self.f, self.l, self.b - - - # 前から見て右回転 (時計回り) - def RotateR(self) -> None: - self.f, self.l, self.b, self.r = self.l, self.b, self.r, self.f - - - def status(self) -> None: - # 上、下、前、後、右、左、(x, y) の順で返す - return self.u, self.d, self.f, self.b, self.r, self.l, self.now_x, self.now_y \ No newline at end of file diff --git a/Math/Dice.py.md b/Math/Dice.py.md new file mode 100644 index 0000000..ab2ad12 --- /dev/null +++ b/Math/Dice.py.md @@ -0,0 +1,78 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_11_A.test.py + title: Test/AOJ/ITP1/ITP1_11_A.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_11_B.test.py + title: Test/AOJ/ITP1/ITP1_11_B.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\n\nclass Dice:\n \"\"\"\u30B5\u30A4\u30B3\u30ED\u306E\u5168\ + \u3066\u306E\u72B6\u614B (up, down, front, back, left, right \u306E\u9806) (u\ + \ + d = f + b = l + r = 7 \u304C\u6210\u308A\u7ACB\u3064)\"\"\"\n state = [\n\ + \ [1, 6, 2, 5, 4, 3], [1, 6, 3, 4, 2, 5], [1, 6, 4, 3, 5, 2], [1, 6,\ + \ 5, 2, 3, 4],\n [2, 5, 1, 6, 3, 4], [2, 5, 3, 4, 6, 1], [2, 5, 4,\ + \ 3, 1, 6], [2, 5, 6, 1, 4, 3],\n [3, 4, 1, 6, 5, 2], [3, 4, 2, 5,\ + \ 1, 6], [3, 4, 5, 2, 6, 1], [3, 4, 6, 1, 2, 5],\n [4, 3, 1, 6, 2,\ + \ 5], [4, 3, 2, 5, 6, 1], [4, 3, 5, 2, 1, 6], [4, 3, 6, 1, 5, 2],\n \ + \ [5, 2, 1, 6, 4, 3], [5, 2, 3, 4, 1, 6], [5, 2, 4, 3, 6, 1], [5, 2, 6, 1, 3,\ + \ 4],\n [6, 1, 2, 5, 3, 4], [6, 1, 3, 4, 5, 2], [6, 1, 4, 3, 2, 5],\ + \ [6, 1, 5, 2, 4, 3]\n ]\n\n def __init__(self, state1: int, value1:\ + \ int, state2: int, value2: int, now_x: int, now_y: int) -> None:\n \"\"\ + \"state1 \u306E\u9762\u304C value1, state2 \u306E\u9762\u304C value2\"\"\"\n \ + \ \"\"\"u, d, f, b, l, r -> 0, 1, 2, 3, 4, 5\"\"\"\n self.now_x =\ + \ now_x\n self.now_y = now_y\n for i in range(24):\n \ + \ if Dice.state[i][state1] == value1 and Dice.state[i][state2] == value2:\n \ + \ self.u, self.d, self.f, self.b, self.l, self.r = Dice.state[i]\n\ + \ break\n else:\n print(\"Error\", file=sys.stderr)\n\ + \ exit()\n\n\n #\u4E0A\u304B\u3089\u898B\u3066y\u8EF8\u306E+\u65B9\ + \u5411\u306B\u56DE\u8EE2 (\u5F8C\u9762\u304C\u4E0B\u9762\u306B\u306A\u308B)\n\ + \ def RotateN(self) -> None:\n self.d, self.f, self.u, self.b = self.b,\ + \ self.d, self.f, self.u\n self.now_y += 1\n\n\n #\u4E0A\u304B\u3089\ + \u898B\u3066y\u8EF8\u306E-\u65B9\u5411\u306B\u56DE\u8EE2 (\u524D\u9762\u304C\u4E0B\ + \u9762\u306B\u306A\u308B)\n def RotateS(self) -> None:\n self.d, self.f,\ + \ self.u ,self.b = self.f, self.u, self.b, self.d\n self.now_y -= 1\n\n\ + \n #\u4E0A\u304B\u3089\u898B\u3066x\u8EF8\u306E+\u65B9\u5411\u306B\u56DE\u8EE2\ + \ (\u53F3\u9762\u304C\u4E0B\u9762\u306B\u306A\u308B)\n def RotateE(self) ->\ + \ None:\n self.d, self.l, self.u, self.r = self.r, self.d, self.l, self.u\n\ + \ self.now_x += 1\n\n\n # \u4E0A\u304B\u3089\u898B\u3066x\u8EF8\u306E\ + -\u65B9\u5411\u306B\u56DE\u8EE2 (\u5DE6\u9762\u304C\u4E0B\u9762\u306B\u306A\u308B\ + )\n def RotateW(self) -> None:\n self.d, self.l, self.u, self.r = self.l,\ + \ self.u, self.r, self.d\n self.now_x -= 1\n\n\n # \u524D\u304B\u3089\ + \u898B\u3066\u5DE6\u56DE\u8EE2 (\u53CD\u6642\u8A08\u56DE\u308A)\n def RotateL(self)\ + \ -> None:\n self.f, self.l, self.b, self.r = self.r, self.f, self.l, self.b\n\ + \n\n # \u524D\u304B\u3089\u898B\u3066\u53F3\u56DE\u8EE2 (\u6642\u8A08\u56DE\ + \u308A)\n def RotateR(self) -> None:\n self.f, self.l, self.b, self.r\ + \ = self.l, self.b, self.r, self.f\n \n\n def status(self) -> None:\n \ + \ # \u4E0A\u3001\u4E0B\u3001\u524D\u3001\u5F8C\u3001\u53F3\u3001\u5DE6\u3001\ + (x, y)\u3000\u306E\u9806\u3067\u8FD4\u3059\n return self.u, self.d, self.f,\ + \ self.b, self.r, self.l, self.now_x, self.now_y" + dependsOn: [] + isVerificationFile: false + path: Math/Dice.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/AOJ/ITP1/ITP1_11_A.test.py + - Test/AOJ/ITP1/ITP1_11_B.test.py +documentation_of: Math/Dice.py +layout: document +redirect_from: +- /library/Math/Dice.py +- /library/Math/Dice.py.html +title: Math/Dice.py +--- diff --git a/Math/DigitSum_int.py b/Math/DigitSum_int.py deleted file mode 100644 index c21cbee..0000000 --- a/Math/DigitSum_int.py +++ /dev/null @@ -1,9 +0,0 @@ -def DigitSum(num: int) -> int: - '''int 型の桁和を求める''' - digit_sum = 0 - - while num > 0: - digit_sum += num % 10 - num //= 10 - - return digit_sum \ No newline at end of file diff --git a/Math/DigitSum_int.py.md b/Math/DigitSum_int.py.md new file mode 100644 index 0000000..0afaef2 --- /dev/null +++ b/Math/DigitSum_int.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_8_B.test.py + title: Test/AOJ/ITP1/ITP1_8_B.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def DigitSum(num: int) -> int:\n '''int \u578B\u306E\u6841\u548C\u3092\ + \u6C42\u3081\u308B'''\n digit_sum = 0\n\n while num > 0:\n digit_sum\ + \ += num % 10\n num //= 10\n\n return digit_sum" + dependsOn: [] + isVerificationFile: false + path: Math/DigitSum_int.py + requiredBy: [] + timestamp: '2023-06-30 09:44:00+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/AOJ/ITP1/ITP1_8_B.test.py +documentation_of: Math/DigitSum_int.py +layout: document +redirect_from: +- /library/Math/DigitSum_int.py +- /library/Math/DigitSum_int.py.html +title: Math/DigitSum_int.py +--- diff --git a/Math/DigitSum_str.py b/Math/DigitSum_str.py deleted file mode 100644 index c3a9546..0000000 --- a/Math/DigitSum_str.py +++ /dev/null @@ -1,5 +0,0 @@ -def DigitSum(num: str) -> int: - '''str 型の桁和を求める''' - return sum([int(num[i]) for i in range(len(num))]) - -print(DigitSum('1234567890')) \ No newline at end of file diff --git a/Math/DigitSum_str.py.md b/Math/DigitSum_str.py.md new file mode 100644 index 0000000..6adcdf9 --- /dev/null +++ b/Math/DigitSum_str.py.md @@ -0,0 +1,33 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def DigitSum(num: str) -> int:\n '''str \u578B\u306E\u6841\u548C\u3092\ + \u6C42\u3081\u308B'''\n return sum([int(num[i]) for i in range(len(num))])\n\ + \nprint(DigitSum('1234567890'))" + dependsOn: [] + isVerificationFile: false + path: Math/DigitSum_str.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/DigitSum_str.py +layout: document +redirect_from: +- /library/Math/DigitSum_str.py +- /library/Math/DigitSum_str.py.html +title: Math/DigitSum_str.py +--- diff --git a/Math/Divisor.py b/Math/Divisor.py deleted file mode 100644 index 968bdf6..0000000 --- a/Math/Divisor.py +++ /dev/null @@ -1,10 +0,0 @@ -def divisors(n: int) -> list: - divisor = [] - for i in range(1, int(n**0.5) + 1): - if n % i == 0: - divisor.append(i) - if i != n // i: - divisor.append(n // i) - - divisor.sort() - return divisor \ No newline at end of file diff --git a/Math/Divisor.py.md b/Math/Divisor.py.md new file mode 100644 index 0000000..c5ac4d6 --- /dev/null +++ b/Math/Divisor.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_3_D.test.py + title: Test/AOJ/ITP1/ITP1_3_D.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2570.test.py + title: Test/yukicoder/2570.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def divisors(n: int) -> list:\n divisor = []\n for i in range(1, int(n**0.5)\ + \ + 1):\n if n % i == 0:\n divisor.append(i)\n if\ + \ i != n // i:\n divisor.append(n // i)\n\n divisor.sort()\n\ + \ return divisor" + dependsOn: [] + isVerificationFile: false + path: Math/Divisor.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/yukicoder/2570.test.py + - Test/AOJ/ITP1/ITP1_3_D.test.py +documentation_of: Math/Divisor.py +layout: document +redirect_from: +- /library/Math/Divisor.py +- /library/Math/Divisor.py.html +title: Math/Divisor.py +--- diff --git a/Math/ExtGCD.py b/Math/ExtGCD.py deleted file mode 100644 index d4d4e38..0000000 --- a/Math/ExtGCD.py +++ /dev/null @@ -1,13 +0,0 @@ -def extgcd(a: int, b: int) -> int: - "ax + by = gcd(a,b) = d となる (x, y, d) を返す" - if b == 0: - return (1, 0, a) - - q, r = a // b, a % b - x, y, d = extgcd(b, r) - s, t = y, x - q * y - - return s, t, d # (qb + r)s + bt = dとなる s, t, d - -ans = extgcd(30, 50) -print(ans) \ No newline at end of file diff --git a/Math/ExtGCD.py.md b/Math/ExtGCD.py.md new file mode 100644 index 0000000..d1698f5 --- /dev/null +++ b/Math/ExtGCD.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def extgcd(a: int, b: int) -> int:\n \"ax + by = gcd(a,b) = d \u3068\u306A\ + \u308B (x, y, d) \u3092\u8FD4\u3059\"\n if b == 0:\n return (1, 0, a)\n\ + \n q, r = a // b, a % b\n x, y, d = extgcd(b, r)\n s, t = y, x - q *\ + \ y\n\n return s, t, d # (qb + r)s + bt = d\u3068\u306A\u308B s, t, d\n\nans\ + \ = extgcd(30, 50)\nprint(ans)" + dependsOn: [] + isVerificationFile: false + path: Math/ExtGCD.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/ExtGCD.py +layout: document +redirect_from: +- /library/Math/ExtGCD.py +- /library/Math/ExtGCD.py.html +title: Math/ExtGCD.py +--- diff --git a/Math/Factorization.py b/Math/Factorization.py deleted file mode 100644 index ab6f581..0000000 --- a/Math/Factorization.py +++ /dev/null @@ -1,22 +0,0 @@ -def factorization(n: int) -> list: - arr, tmp = [], n - for i in range(2, int(-(-n ** 0.5 // 1)) + 1): - if tmp % i == 0: - cnt = 0 - while tmp % i == 0: - cnt += 1 - tmp //= i - arr.append([i, cnt]) - - if tmp != 1: - arr.append([tmp, 1]) - - return arr - - -def main() -> None: - print(factorization(2592)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Math/Factorization.py.md b/Math/Factorization.py.md new file mode 100644 index 0000000..cc2897e --- /dev/null +++ b/Math/Factorization.py.md @@ -0,0 +1,48 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0002.test.py + title: Test/yukicoder/0002.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0847.test.py + title: Test/yukicoder/0847.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1737.test.py + title: Test/yukicoder/1737.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def factorization(n: int) -> list:\n arr, tmp = [], n\n for i in range(2,\ + \ int(-(-n ** 0.5 // 1)) + 1):\n if tmp % i == 0:\n cnt = 0\n\ + \ while tmp % i == 0:\n cnt += 1\n tmp\ + \ //= i\n arr.append([i, cnt])\n\n if tmp != 1:\n arr.append([tmp,\ + \ 1])\n\n return arr\n\n\ndef main() -> None:\n print(factorization(2592))\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Math/Factorization.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/yukicoder/0002.test.py + - Test/yukicoder/1737.test.py + - Test/yukicoder/0847.test.py +documentation_of: Math/Factorization.py +layout: document +redirect_from: +- /library/Math/Factorization.py +- /library/Math/Factorization.py.html +title: Math/Factorization.py +--- diff --git a/Math/FromFloatToInt.py b/Math/FromFloatToInt.py deleted file mode 100644 index f9a9771..0000000 --- a/Math/FromFloatToInt.py +++ /dev/null @@ -1,6 +0,0 @@ -def FloatToInt(FLOAT): - return int(FLOAT.replace(".", "")), len(FLOAT) - FLOAT.index(".") - 1 # tuple でreturn - -n = "314.1592653589" # 開始はstrで渡す -x, y = FloatToInt(n) -print(x, y) \ No newline at end of file diff --git a/Math/FromFloatToInt.py.md b/Math/FromFloatToInt.py.md new file mode 100644 index 0000000..f7f636e --- /dev/null +++ b/Math/FromFloatToInt.py.md @@ -0,0 +1,33 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def FloatToInt(FLOAT):\n return int(FLOAT.replace(\".\", \"\")), len(FLOAT)\ + \ - FLOAT.index(\".\") - 1 # tuple \u3067return\n\nn = \"314.1592653589\" # \u958B\ + \u59CB\u306Fstr\u3067\u6E21\u3059\nx, y = FloatToInt(n)\nprint(x, y)" + dependsOn: [] + isVerificationFile: false + path: Math/FromFloatToInt.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/FromFloatToInt.py +layout: document +redirect_from: +- /library/Math/FromFloatToInt.py +- /library/Math/FromFloatToInt.py.html +title: Math/FromFloatToInt.py +--- diff --git a/Math/ManhattanDistanceSearch.py b/Math/ManhattanDistanceSearch.py deleted file mode 100644 index feda9ec..0000000 --- a/Math/ManhattanDistanceSearch.py +++ /dev/null @@ -1,34 +0,0 @@ -def manhattan_distance(li: list, k: int) -> int: # 返り値注意 - "マンハッタン距離で行ける場所を全探索する(tはマンハッタン距離の半径)" - tmp = 0 # ここは例 - for i in range(k - 1, h - (k - 1)): - for j in range(k - 1, w - (k - 1)): - cnt = 0 # ここは例 - for t in range(2): - if t == 0: # ((i,j)マスを含む k 個) - for l in reversed(range(k)): - for x in range(j - l, j + l + 1): - y = i - (k - (l + 1)) - if li[y][x] == "1": cnt += 1 # ここは例 - elif t == 1: # ((i,j)マスを含まない k-1 個) - for l in reversed(range(k - 1)): - for x in range(j - l, j + l + 1): - y = i + (k - (l + 1)) - if li[y][x] == "1": cnt += 1 # ここは例 - tmp = max(tmp, cnt) # ここは例 - return tmp # ここは例 - -""" -5 6 2 -010111 -100100 -010010 -100101 -011010 - -上図の 5*6 のグリッドで k=2 の時の 1 の含まれる最大の個数を出力する -""" -h, w, k = map(int,input().split()) # 縦、横、マンハッタン距離の半径 -grid = [list(input().rstrip()) for _ in range(h)] -ans = manhattan_distance(grid, k) -print(ans) \ No newline at end of file diff --git a/Math/ManhattanDistanceSearch.py.md b/Math/ManhattanDistanceSearch.py.md new file mode 100644 index 0000000..6555b07 --- /dev/null +++ b/Math/ManhattanDistanceSearch.py.md @@ -0,0 +1,52 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def manhattan_distance(li: list, k: int) -> int: # \u8FD4\u308A\u5024\u6CE8\ + \u610F\n \"\u30DE\u30F3\u30CF\u30C3\u30BF\u30F3\u8DDD\u96E2\u3067\u884C\u3051\ + \u308B\u5834\u6240\u3092\u5168\u63A2\u7D22\u3059\u308B\uFF08t\u306F\u30DE\u30F3\ + \u30CF\u30C3\u30BF\u30F3\u8DDD\u96E2\u306E\u534A\u5F84\uFF09\"\n tmp = 0 #\ + \ \u3053\u3053\u306F\u4F8B\n for i in range(k - 1, h - (k - 1)):\n for\ + \ j in range(k - 1, w - (k - 1)):\n cnt = 0 # \u3053\u3053\u306F\u4F8B\ + \n for t in range(2):\n if t == 0: # ((i,j)\u30DE\u30B9\ + \u3092\u542B\u3080 k \u500B)\n for l in reversed(range(k)):\n\ + \ for x in range(j - l, j + l + 1):\n \ + \ y = i - (k - (l + 1))\n if li[y][x] ==\ + \ \"1\": cnt += 1 # \u3053\u3053\u306F\u4F8B\n elif t == 1: # ((i,j)\u30DE\ + \u30B9\u3092\u542B\u307E\u306A\u3044 k-1 \u500B)\n for l in\ + \ reversed(range(k - 1)):\n for x in range(j - l, j + l\ + \ + 1):\n y = i + (k - (l + 1))\n \ + \ if li[y][x] == \"1\": cnt += 1 # \u3053\u3053\u306F\u4F8B\n \ + \ tmp = max(tmp, cnt) # \u3053\u3053\u306F\u4F8B\n return tmp # \u3053\ + \u3053\u306F\u4F8B\n\n\"\"\"\n5 6 2\n010111\n100100\n010010\n100101\n011010\n\n\ + \u4E0A\u56F3\u306E 5*6 \u306E\u30B0\u30EA\u30C3\u30C9\u3067 k=2 \u306E\u6642\u306E\ + \ 1 \u306E\u542B\u307E\u308C\u308B\u6700\u5927\u306E\u500B\u6570\u3092\u51FA\u529B\ + \u3059\u308B\n\"\"\"\nh, w, k = map(int,input().split()) # \u7E26\u3001\u6A2A\u3001\ + \u30DE\u30F3\u30CF\u30C3\u30BF\u30F3\u8DDD\u96E2\u306E\u534A\u5F84\ngrid = [list(input().rstrip())\ + \ for _ in range(h)]\nans = manhattan_distance(grid, k)\nprint(ans)" + dependsOn: [] + isVerificationFile: false + path: Math/ManhattanDistanceSearch.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/ManhattanDistanceSearch.py +layout: document +redirect_from: +- /library/Math/ManhattanDistanceSearch.py +- /library/Math/ManhattanDistanceSearch.py.html +title: Math/ManhattanDistanceSearch.py +--- diff --git a/Math/MatrixPow.py b/Math/MatrixPow.py deleted file mode 100644 index 6a195ce..0000000 --- a/Math/MatrixPow.py +++ /dev/null @@ -1,42 +0,0 @@ -def matrix_multi(a: list, b: list, mod=998244353) -> list: - len_a, len_b, len_b_zero = len(a), len(b), len(b[0]) - c = [[0] * len(b[0]) for _ in range(len_a)] - for i in range(len_a): - for j in range(len_b_zero): - for k in range(len_b): - c[i][j] += a[i][k] * b[k][j] - c[i][j] %= mod - - return c - - -def matrix_pow(a: list, n: int) -> list: - len_a = len(a) - cnt = [[0] * len_a for _ in range(len_a)] - - for i in range(len_a): - cnt[i][i] = 1 - - while n > 0: - if n & 1: - cnt = matrix_multi(a, cnt) - - a = matrix_multi(a, a) - n >>= 1 - - return cnt - - -def main() -> None: - n = int(input()) - - fibonacci = [[1, 1], [1, 0]] - fibonacci = matrix_pow(fibonacci, n) - - ans = fibonacci[1][0] - # print(*fibonacci, sep="\n") - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Math/MatrixPow.py.md b/Math/MatrixPow.py.md new file mode 100644 index 0000000..a7a9fb2 --- /dev/null +++ b/Math/MatrixPow.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def matrix_multi(a: list, b: list, mod=998244353) -> list:\n len_a, len_b,\ + \ len_b_zero = len(a), len(b), len(b[0])\n c = [[0] * len(b[0]) for _ in range(len_a)]\n\ + \ for i in range(len_a):\n for j in range(len_b_zero):\n \ + \ for k in range(len_b):\n c[i][j] += a[i][k] * b[k][j]\n \ + \ c[i][j] %= mod\n\n return c\n\n\ndef matrix_pow(a: list, n: int)\ + \ -> list:\n len_a = len(a)\n cnt = [[0] * len_a for _ in range(len_a)]\n\ + \n for i in range(len_a):\n cnt[i][i] = 1\n\n while n > 0:\n \ + \ if n & 1:\n cnt = matrix_multi(a, cnt)\n\n a = matrix_multi(a,\ + \ a)\n n >>= 1\n\n return cnt\n\n\ndef main() -> None:\n n = int(input())\n\ + \n fibonacci = [[1, 1], [1, 0]]\n fibonacci = matrix_pow(fibonacci, n)\n\ + \n ans = fibonacci[1][0]\n # print(*fibonacci, sep=\"\\n\")\n print(ans)\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Math/MatrixPow.py + requiredBy: [] + timestamp: '2023-11-10 19:18:05+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/MatrixPow.py +layout: document +redirect_from: +- /library/Math/MatrixPow.py +- /library/Math/MatrixPow.py.html +title: Math/MatrixPow.py +--- diff --git a/Math/MaxCumulativeSum.py b/Math/MaxCumulativeSum.py deleted file mode 100644 index 3b041d0..0000000 --- a/Math/MaxCumulativeSum.py +++ /dev/null @@ -1,24 +0,0 @@ -def MaxCumulativeSum(num_array: list, k: int): - max_cumulative_sum = [] - count = 0 - for i in range(k): - count += num_array[i] - max_cumulative_sum.append([count, 0, 0 + k]) - - for i in range(len(num_array) - k): - count += num_array[i + k] - count -= num_array[i] - max_cumulative_sum.append([count, i + 1, i + 1 + k]) - - max_cumulative_sum.sort(key = lambda x: x[0], reverse=True) - return max_cumulative_sum[0] - - -def main() -> None: - a = [1, 4, -1, 9, 34, 21, -12, 31] - ans = MaxCumulativeSum(a, 3) # 配列・区間幅 - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Math/MaxCumulativeSum.py.md b/Math/MaxCumulativeSum.py.md new file mode 100644 index 0000000..76da920 --- /dev/null +++ b/Math/MaxCumulativeSum.py.md @@ -0,0 +1,43 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume5/0516.test.py + title: Test/AOJ/Volume5/0516.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def MaxCumulativeSum(num_array: list, k: int):\n max_cumulative_sum =\ + \ []\n count = 0\n for i in range(k):\n count += num_array[i]\n \ + \ max_cumulative_sum.append([count, 0, 0 + k])\n \n for i in range(len(num_array)\ + \ - k):\n count += num_array[i + k]\n count -= num_array[i]\n \ + \ max_cumulative_sum.append([count, i + 1, i + 1 + k])\n \n max_cumulative_sum.sort(key\ + \ = lambda x: x[0], reverse=True)\n return max_cumulative_sum[0]\n\n\ndef main()\ + \ -> None:\n a = [1, 4, -1, 9, 34, 21, -12, 31]\n ans = MaxCumulativeSum(a,\ + \ 3) # \u914D\u5217\u30FB\u533A\u9593\u5E45\n print(ans)\n\n\nif __name__ ==\ + \ \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Math/MaxCumulativeSum.py + requiredBy: [] + timestamp: '2023-06-29 17:50:03+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/AOJ/Volume5/0516.test.py +documentation_of: Math/MaxCumulativeSum.py +layout: document +redirect_from: +- /library/Math/MaxCumulativeSum.py +- /library/Math/MaxCumulativeSum.py.html +title: Math/MaxCumulativeSum.py +--- diff --git a/Math/NFactorizarition.py b/Math/NFactorizarition.py deleted file mode 100644 index 002f834..0000000 --- a/Math/NFactorizarition.py +++ /dev/null @@ -1,33 +0,0 @@ -# 2msの場合は10^6まで行ける -def primes_list(n): - """エラトステネスの篩でn以下の素数を全列挙する""" - if n == 0: - return [] - is_prime = [True] * (n + 1) - is_prime[0] = False - is_prime[1] = False - for i in range(2, int(n ** 0.5) + 1): - if not is_prime[i]: continue - for j in range(i * 2, n + 1, i): - is_prime[j] = False - return [i for i in range(n + 1) if is_prime[i]] - -def nCkFactorization(k: int) -> list: - """1,2, ... ,n を全て素因数分解する""" - - divisors = [[] for _ in range(k + 1)] - a = [i for i in range(k + 1)] - num = primes_list(k) - - for p in num: - for i in range(p, k + 1, p): - while a[i] % p == 0: - divisors[i].append(p) - a[i] //= p - - return divisors - -num = nCkFactorization(100) -#print(*num, sep="\n") -for i in range(len(num)): - print(i, num[i]) \ No newline at end of file diff --git a/Math/NFactorizarition.py.md b/Math/NFactorizarition.py.md new file mode 100644 index 0000000..d697b23 --- /dev/null +++ b/Math/NFactorizarition.py.md @@ -0,0 +1,44 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# 2ms\u306E\u5834\u5408\u306F10^6\u307E\u3067\u884C\u3051\u308B\ndef primes_list(n):\n\ + \ \"\"\"\u30A8\u30E9\u30C8\u30B9\u30C6\u30CD\u30B9\u306E\u7BE9\u3067n\u4EE5\ + \u4E0B\u306E\u7D20\u6570\u3092\u5168\u5217\u6319\u3059\u308B\"\"\"\n if n ==\ + \ 0:\n return []\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]: continue\n for j in range(i * 2, n + 1, i):\n \ + \ is_prime[j] = False\n return [i for i in range(n + 1) if is_prime[i]]\n\ + \ndef nCkFactorization(k: int) -> list:\n \"\"\"1,2, ... ,n \u3092\u5168\u3066\ + \u7D20\u56E0\u6570\u5206\u89E3\u3059\u308B\"\"\"\n\n divisors = [[] for _ in\ + \ range(k + 1)]\n a = [i for i in range(k + 1)]\n num = primes_list(k)\n\ + \n for p in num:\n for i in range(p, k + 1, p):\n while a[i]\ + \ % p == 0:\n divisors[i].append(p)\n a[i] //= p\n\ + \n return divisors\n\nnum = nCkFactorization(100)\n#print(*num, sep=\"\\n\"\ + )\nfor i in range(len(num)):\n print(i, num[i])" + dependsOn: [] + isVerificationFile: false + path: Math/NFactorizarition.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/NFactorizarition.py +layout: document +redirect_from: +- /library/Math/NFactorizarition.py +- /library/Math/NFactorizarition.py.html +title: Math/NFactorizarition.py +--- diff --git a/Math/PrimaryCheck.py b/Math/PrimaryCheck.py deleted file mode 100644 index 89eacb5..0000000 --- a/Math/PrimaryCheck.py +++ /dev/null @@ -1,9 +0,0 @@ -def PrimaryCheck(x: int) -> bool: - if x == 1: - return False - - for i in range(2, int(x ** 0.5) + 1): - if x % i == 0: - return False - - return True \ No newline at end of file diff --git a/Math/PrimaryCheck.py.md b/Math/PrimaryCheck.py.md new file mode 100644 index 0000000..83b2dce --- /dev/null +++ b/Math/PrimaryCheck.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/ALDS1/ALDS1_1_C.test.py + title: Test/AOJ/ALDS1/ALDS1_1_C.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def PrimaryCheck(x: int) -> bool:\n if x == 1:\n return False\n\ + \n for i in range(2, int(x ** 0.5) + 1):\n if x % i == 0:\n \ + \ return False\n\n return True" + dependsOn: [] + isVerificationFile: false + path: Math/PrimaryCheck.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/AOJ/ALDS1/ALDS1_1_C.test.py +documentation_of: Math/PrimaryCheck.py +layout: document +redirect_from: +- /library/Math/PrimaryCheck.py +- /library/Math/PrimaryCheck.py.html +title: Math/PrimaryCheck.py +--- diff --git a/Math/SieveOfEratosthenes.py b/Math/SieveOfEratosthenes.py deleted file mode 100644 index 1abb19a..0000000 --- a/Math/SieveOfEratosthenes.py +++ /dev/null @@ -1,23 +0,0 @@ -def primes(n: int) -> list: - "素数の列挙を行う" - - is_prime = [True] * (n + 1) - is_prime[0] = False - is_prime[1] = False - - for i in range(2, int(n ** 0.5) + 1): - if not is_prime[i]: - continue - for j in range(i * 2, n + 1, i): - is_prime[j] = False - - return [i for i, j in enumerate(is_prime) if j] - - -def main() -> None: - x = primes(100) - print(len(x), x) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Math/SieveOfEratosthenes.py.md b/Math/SieveOfEratosthenes.py.md new file mode 100644 index 0000000..b91c525 --- /dev/null +++ b/Math/SieveOfEratosthenes.py.md @@ -0,0 +1,49 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume11/1172.test.py + title: Test/AOJ/Volume11/1172.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0007.test.py + title: Test/yukicoder/0007.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0713.test.py + title: Test/yukicoder/0713.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def primes(n: int) -> list:\n \"\u7D20\u6570\u306E\u5217\u6319\u3092\u884C\ + \u3046\"\n\n is_prime = [True] * (n + 1)\n is_prime[0] = False\n is_prime[1]\ + \ = False\n\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\n return [i for i, j in enumerate(is_prime) if j]\n\n\ndef main()\ + \ -> None:\n x = primes(100)\n print(len(x), x)\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: false + path: Math/SieveOfEratosthenes.py + requiredBy: [] + timestamp: '2023-06-29 01:19:46+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/yukicoder/0713.test.py + - Test/yukicoder/0007.test.py + - Test/AOJ/Volume11/1172.test.py +documentation_of: Math/SieveOfEratosthenes.py +layout: document +redirect_from: +- /library/Math/SieveOfEratosthenes.py +- /library/Math/SieveOfEratosthenes.py.html +title: Math/SieveOfEratosthenes.py +--- diff --git a/Math/SortedMultiset.py b/Math/SortedMultiset.py deleted file mode 100644 index 3e40de3..0000000 --- a/Math/SortedMultiset.py +++ /dev/null @@ -1,188 +0,0 @@ -# 99.99% tatyam さんが公開されている SortedMultiset を使用しています -# 一部自分用に変換しています - -# https://github.com/tatyam-prime/SortedSet/blob/main/SortedMultiset.py - -# https://qiita.com/tatyam/items/492c70ac4c955c055602 - -''' -SortedMultisetの使用例 - -ABC253-C - Max - Min Query https://atcoder.jp/contests/abc253/tasks/abc253_c -''' - - -from math import ceil, sqrt -from bisect import bisect_left, bisect_right, insort -from typing import Generic, Iterable, Iterator, TypeVar, Union, List -T = TypeVar('T') - -class SortedMultiset(Generic[T]): - BUCKET_RATIO = 50 - REBUILD_RATIO = 170 - - - def _build(self, a=None) -> None: - "Evenly divide `a` into buckets." - if a is None: - a = list(self) - - size = self.size = len(a) - bucket_size = int(ceil(sqrt(size / self.BUCKET_RATIO))) - self.a = [a[size * i // bucket_size : size * (i + 1) // bucket_size] for i in range(bucket_size)] - - - def __init__(self, a: Iterable[T] = []) -> None: - "Make a new SortedMultiset from iterable. / O(N) if sorted / O(N log N)" - a = list(a) - if not all(a[i] <= a[i + 1] for i in range(len(a) - 1)): - a = sorted(a) - self._build(a) - - - def __iter__(self) -> Iterator[T]: - for i in self.a: - for j in i: - yield j - - - def __reversed__(self) -> Iterator[T]: - for i in reversed(self.a): - for j in reversed(i): - yield j - - - def __len__(self) -> int: - return self.size - - - def __repr__(self) -> str: - return "SortedMultiset" + str(self.a) - - - def __str__(self) -> str: - s = str(list(self)) - return "{" + s[1 : len(s) - 1] + "}" - - - def _find_bucket(self, x: T) -> List[T]: - "Find the bucket which should contain x. self must not be empty." - for a in self.a: - if x <= a[-1]: - return a - - return a - - - def __contains__(self, x: T) -> bool: - if self.size == 0: - return False - - a = self._find_bucket(x) - i = bisect_left(a, x) - return i != len(a) and a[i] == x - - - def count(self, x: T) -> int: - "Count the number of x." - return self.index_right(x) - self.index(x) - - - def add(self, x: T) -> None: - "Add an element. / O(√N)" - if self.size == 0: - self.a = [[x]] - self.size = 1 - return - - a = self._find_bucket(x) - insort(a, x) - self.size += 1 - - if len(a) > len(self.a) * self.REBUILD_RATIO: - self._build() - - - def discard(self, x: T) -> bool: - "Remove an element and return True if removed. / O(√N)" - if self.size == 0: - return False - - a = self._find_bucket(x) - i = bisect_left(a, x) - - if i == len(a) or a[i] != x: - return False - - a.pop(i) - self.size -= 1 - - if len(a) == 0: - self._build() - - return True - - - def lt(self, x: T) -> Union[T, None]: - "Find the largest element < x, or None if it doesn't exist." - for a in reversed(self.a): - if a[0] < x: - return a[bisect_left(a, x) - 1] - - - def le(self, x: T) -> Union[T, None]: - "Find the largest element <= x, or None if it doesn't exist." - for a in reversed(self.a): - if a[0] <= x: - return a[bisect_right(a, x) - 1] - - - def gt(self, x: T) -> Union[T, None]: - "Find the smallest element > x, or None if it doesn't exist." - for a in self.a: - if a[-1] > x: - return a[bisect_right(a, x)] - - - def ge(self, x: T) -> Union[T, None]: - "Find the smallest element >= x, or None if it doesn't exist." - for a in self.a: - if a[-1] >= x: - return a[bisect_left(a, x)] - - - def __getitem__(self, x: int) -> T: - "Return the x-th element, or IndexError if it doesn't exist." - if x < 0: - x += self.size - - if x < 0: - raise IndexError - - for a in self.a: - if x < len(a): return a[x] - x -= len(a) - - raise IndexError - - - def index(self, x: T) -> int: - "Count the number of elements < x." - ans = 0 - for a in self.a: - if a[-1] >= x: - return ans + bisect_left(a, x) - ans += len(a) - - return ans - - - def index_right(self, x: T) -> int: - "Count the number of elements <= x." - ans = 0 - for a in self.a: - if a[-1] > x: - return ans + bisect_right(a, x) - ans += len(a) - - return ans \ No newline at end of file diff --git a/Math/SortedMultiset.py.md b/Math/SortedMultiset.py.md new file mode 100644 index 0000000..d94db7a --- /dev/null +++ b/Math/SortedMultiset.py.md @@ -0,0 +1,95 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: + - https://atcoder.jp/contests/abc253/tasks/abc253_c + - https://github.com/tatyam-prime/SortedSet/blob/main/SortedMultiset.py + - https://qiita.com/tatyam/items/492c70ac4c955c055602 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# 99.99% tatyam \u3055\u3093\u304C\u516C\u958B\u3055\u308C\u3066\u3044\u308B\ + \ SortedMultiset \u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\n# \u4E00\u90E8\ + \u81EA\u5206\u7528\u306B\u5909\u63DB\u3057\u3066\u3044\u307E\u3059\n\n# https://github.com/tatyam-prime/SortedSet/blob/main/SortedMultiset.py\n\ + \n# https://qiita.com/tatyam/items/492c70ac4c955c055602\n\n'''\nSortedMultiset\u306E\ + \u4F7F\u7528\u4F8B\n\nABC253-C - Max - Min Query https://atcoder.jp/contests/abc253/tasks/abc253_c\n\ + '''\n\n\nfrom math import ceil, sqrt\nfrom bisect import bisect_left, bisect_right,\ + \ insort\nfrom typing import Generic, Iterable, Iterator, TypeVar, Union, List\n\ + T = TypeVar('T')\n\nclass SortedMultiset(Generic[T]):\n BUCKET_RATIO = 50\n\ + \ REBUILD_RATIO = 170\n\n\n def _build(self, a=None) -> None:\n \"\ + Evenly divide `a` into buckets.\"\n if a is None:\n a = list(self)\n\ + \n size = self.size = len(a)\n bucket_size = int(ceil(sqrt(size\ + \ / self.BUCKET_RATIO)))\n self.a = [a[size * i // bucket_size : size *\ + \ (i + 1) // bucket_size] for i in range(bucket_size)]\n \n\n def __init__(self,\ + \ a: Iterable[T] = []) -> None:\n \"Make a new SortedMultiset from iterable.\ + \ / O(N) if sorted / O(N log N)\"\n a = list(a)\n if not all(a[i]\ + \ <= a[i + 1] for i in range(len(a) - 1)):\n a = sorted(a)\n \ + \ self._build(a)\n\n\n def __iter__(self) -> Iterator[T]:\n for i in\ + \ self.a:\n for j in i:\n yield j\n\n\n def __reversed__(self)\ + \ -> Iterator[T]:\n for i in reversed(self.a):\n for j in reversed(i):\n\ + \ yield j\n \n\n def __len__(self) -> int:\n return\ + \ self.size\n \n\n def __repr__(self) -> str:\n return \"SortedMultiset\"\ + \ + str(self.a)\n \n \n def __str__(self) -> str:\n s = str(list(self))\n\ + \ return \"{\" + s[1 : len(s) - 1] + \"}\"\n\n\n def _find_bucket(self,\ + \ x: T) -> List[T]:\n \"Find the bucket which should contain x. self must\ + \ not be empty.\"\n for a in self.a:\n if x <= a[-1]:\n \ + \ return a\n\n return a\n\n\n def __contains__(self, x: T)\ + \ -> bool:\n if self.size == 0:\n return False\n\n a\ + \ = self._find_bucket(x)\n i = bisect_left(a, x)\n return i != len(a)\ + \ and a[i] == x\n\n\n def count(self, x: T) -> int:\n \"Count the number\ + \ of x.\"\n return self.index_right(x) - self.index(x)\n\n\n def add(self,\ + \ x: T) -> None:\n \"Add an element. / O(\u221AN)\"\n if self.size\ + \ == 0:\n self.a = [[x]]\n self.size = 1\n return\n\ + \n a = self._find_bucket(x)\n insort(a, x)\n self.size +=\ + \ 1\n\n if len(a) > len(self.a) * self.REBUILD_RATIO:\n self._build()\n\ + \n\n def discard(self, x: T) -> bool:\n \"Remove an element and return\ + \ True if removed. / O(\u221AN)\"\n if self.size == 0:\n return\ + \ False\n\n a = self._find_bucket(x)\n i = bisect_left(a, x)\n\n\ + \ if i == len(a) or a[i] != x:\n return False\n\n a.pop(i)\n\ + \ self.size -= 1\n\n if len(a) == 0:\n self._build()\n\ + \n return True\n\n\n def lt(self, x: T) -> Union[T, None]:\n \ + \ \"Find the largest element < x, or None if it doesn't exist.\"\n for\ + \ a in reversed(self.a):\n if a[0] < x:\n return a[bisect_left(a,\ + \ x) - 1]\n\n\n def le(self, x: T) -> Union[T, None]:\n \"Find the largest\ + \ element <= x, or None if it doesn't exist.\"\n for a in reversed(self.a):\n\ + \ if a[0] <= x:\n return a[bisect_right(a, x) - 1]\n\ + \n\n def gt(self, x: T) -> Union[T, None]:\n \"Find the smallest element\ + \ > x, or None if it doesn't exist.\"\n for a in self.a:\n if\ + \ a[-1] > x:\n return a[bisect_right(a, x)]\n\n \n def ge(self,\ + \ x: T) -> Union[T, None]:\n \"Find the smallest element >= x, or None\ + \ if it doesn't exist.\"\n for a in self.a:\n if a[-1] >= x:\n\ + \ return a[bisect_left(a, x)]\n \n\n def __getitem__(self,\ + \ x: int) -> T:\n \"Return the x-th element, or IndexError if it doesn't\ + \ exist.\"\n if x < 0:\n x += self.size\n\n if x < 0:\n\ + \ raise IndexError\n\n for a in self.a:\n if x <\ + \ len(a): return a[x]\n x -= len(a)\n \n raise IndexError\n\ + \n\n def index(self, x: T) -> int:\n \"Count the number of elements\ + \ < x.\"\n ans = 0\n for a in self.a:\n if a[-1] >= x:\n\ + \ return ans + bisect_left(a, x)\n ans += len(a)\n\n\ + \ return ans\n\n\n def index_right(self, x: T) -> int:\n \"Count\ + \ the number of elements <= x.\"\n ans = 0\n for a in self.a:\n\ + \ if a[-1] > x:\n return ans + bisect_right(a, x)\n\ + \ ans += len(a)\n\n return ans" + dependsOn: [] + isVerificationFile: false + path: Math/SortedMultiset.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/SortedMultiset.py +layout: document +redirect_from: +- /library/Math/SortedMultiset.py +- /library/Math/SortedMultiset.py.html +title: Math/SortedMultiset.py +--- diff --git a/Math/SortedSet.py b/Math/SortedSet.py deleted file mode 100644 index 6a987e9..0000000 --- a/Math/SortedSet.py +++ /dev/null @@ -1,192 +0,0 @@ -# 99.99% tatyam さんが公開されている SortedSet を使用しています -# 一部自分用に変換しています - -# https://github.com/tatyam-prime/SortedSet/blob/main/SortedSet.py - -# https://qiita.com/tatyam/items/492c70ac4c955c055602 - -''' -使用例 - -ABC217-D - CuttingWoods https://atcoder.jp/contests/abc217/tasks/abc217_d -https://atcoder.jp/contests/abc217/submissions/32096323 - -ABC260-D - Draw Your Cards https://atcoder.jp/contests/abc260/tasks/abc260_d -https://atcoder.jp/contests/abc260/submissions/33353118 -''' - -from math import ceil, sqrt -from bisect import bisect_left, bisect_right -from typing import Generic, Iterable, Iterator, TypeVar, Union, List -T = TypeVar('T') - -class SortedSet(Generic[T]): - BUCKET_RATIO = 50 - REBUILD_RATIO = 170 - - def _build(self, a=None) -> None: - "Evenly divide `a` into buckets." - if a is None: - a = list(self) - size = self.size = len(a) - bucket_size = int(ceil(sqrt(size / self.BUCKET_RATIO))) - self.a = [a[size * i // bucket_size : size * (i + 1) // bucket_size] for i in range(bucket_size)] - - - def __init__(self, a: Iterable[T] = []) -> None: - "Make a new SortedSet from iterable. / O(N) if sorted and unique / O(N log N)" - a = list(a) - if not all(a[i] < a[i + 1] for i in range(len(a) - 1)): - a = sorted(set(a)) - self._build(a) - - - def __iter__(self) -> Iterator[T]: - for i in self.a: - for j in i: - yield j - - - def __reversed__(self) -> Iterator[T]: - for i in reversed(self.a): - for j in reversed(i): - yield j - - - def __len__(self) -> int: - return self.size - - - def __repr__(self) -> str: - return "SortedSet" + str(self.a) - - - def __str__(self) -> str: - s = str(list(self)) - return "{" + s[1 : len(s) - 1] + "}" - - - def _find_bucket(self, x: T) -> List[T]: - "Find the bucket which should contain x. self must not be empty." - for a in self.a: - if x <= a[-1]: - return a - - return a - - - def __contains__(self, x: T) -> bool: - if self.size == 0: - return False - - a = self._find_bucket(x) - i = bisect_left(a, x) - - return i != len(a) and a[i] == x - - - def add(self, x: T) -> bool: - "Add an element and return True if added. / O(√N)" - if self.size == 0: - self.a = [[x]] - self.size = 1 - return True - - a = self._find_bucket(x) - i = bisect_left(a, x) - - if i != len(a) and a[i] == x: - return False - - a.insert(i, x) - self.size += 1 - if len(a) > len(self.a) * self.REBUILD_RATIO: - self._build() - - return True - - - def discard(self, x: T) -> bool: - "Remove an element and return True if removed. / O(√N)" - if self.size == 0: - return False - - a = self._find_bucket(x) - i = bisect_left(a, x) - - if i == len(a) or a[i] != x: - return False - - a.pop(i) - self.size -= 1 - - if len(a) == 0: - self._build() - - return True - - - def lt(self, x: T) -> Union[T, None]: - "Find the largest element < x, or None if it doesn't exist." - for a in reversed(self.a): - if a[0] < x: - return a[bisect_left(a, x) - 1] - - - def le(self, x: T) -> Union[T, None]: - "Find the largest element <= x, or None if it doesn't exist." - for a in reversed(self.a): - if a[0] <= x: - return a[bisect_right(a, x) - 1] - - - def gt(self, x: T) -> Union[T, None]: - "Find the smallest element > x, or None if it doesn't exist." - for a in self.a: - if a[-1] > x: - return a[bisect_right(a, x)] - - - def ge(self, x: T) -> Union[T, None]: - "Find the smallest element >= x, or None if it doesn't exist." - for a in self.a: - if a[-1] >= x: - return a[bisect_left(a, x)] - - - def __getitem__(self, x: int) -> T: - "Return the x-th element, or IndexError if it doesn't exist." - if x < 0: - x += self.size - - if x < 0: - raise IndexError - - for a in self.a: - if x < len(a): - return a[x] - x -= len(a) - - raise IndexError - - - def index(self, x: T) -> int: - "Count the number of elements < x." - ans = 0 - for a in self.a: - if a[-1] >= x: - return ans + bisect_left(a, x) - ans += len(a) - - return ans - - - def index_right(self, x: T) -> int: - "Count the number of elements <= x." - ans = 0 - for a in self.a: - if a[-1] > x: - return ans + bisect_right(a, x) - ans += len(a) - - return ans \ No newline at end of file diff --git a/Math/SortedSet.py.md b/Math/SortedSet.py.md new file mode 100644 index 0000000..9f73ee0 --- /dev/null +++ b/Math/SortedSet.py.md @@ -0,0 +1,101 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: + - https://atcoder.jp/contests/abc217/submissions/32096323 + - https://atcoder.jp/contests/abc217/tasks/abc217_d + - https://atcoder.jp/contests/abc260/submissions/33353118 + - https://atcoder.jp/contests/abc260/tasks/abc260_d + - https://github.com/tatyam-prime/SortedSet/blob/main/SortedSet.py + - https://qiita.com/tatyam/items/492c70ac4c955c055602 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# 99.99% tatyam \u3055\u3093\u304C\u516C\u958B\u3055\u308C\u3066\u3044\u308B\ + \ SortedSet \u3092\u4F7F\u7528\u3057\u3066\u3044\u307E\u3059\n# \u4E00\u90E8\u81EA\ + \u5206\u7528\u306B\u5909\u63DB\u3057\u3066\u3044\u307E\u3059\n\n# https://github.com/tatyam-prime/SortedSet/blob/main/SortedSet.py\n\ + \n# https://qiita.com/tatyam/items/492c70ac4c955c055602\n\n'''\n\u4F7F\u7528\u4F8B\ + \n\nABC217-D - CuttingWoods https://atcoder.jp/contests/abc217/tasks/abc217_d\n\ + https://atcoder.jp/contests/abc217/submissions/32096323\n\nABC260-D - Draw Your\ + \ Cards https://atcoder.jp/contests/abc260/tasks/abc260_d\nhttps://atcoder.jp/contests/abc260/submissions/33353118\n\ + '''\n\nfrom math import ceil, sqrt\nfrom bisect import bisect_left, bisect_right\n\ + from typing import Generic, Iterable, Iterator, TypeVar, Union, List\nT = TypeVar('T')\n\ + \nclass SortedSet(Generic[T]):\n BUCKET_RATIO = 50\n REBUILD_RATIO = 170\n\ + \n def _build(self, a=None) -> None:\n \"Evenly divide `a` into buckets.\"\ + \n if a is None:\n a = list(self)\n size = self.size\ + \ = len(a)\n bucket_size = int(ceil(sqrt(size / self.BUCKET_RATIO)))\n\ + \ self.a = [a[size * i // bucket_size : size * (i + 1) // bucket_size]\ + \ for i in range(bucket_size)]\n \n\n def __init__(self, a: Iterable[T]\ + \ = []) -> None:\n \"Make a new SortedSet from iterable. / O(N) if sorted\ + \ and unique / O(N log N)\"\n a = list(a)\n if not all(a[i] < a[i\ + \ + 1] for i in range(len(a) - 1)):\n a = sorted(set(a))\n self._build(a)\n\ + \n\n def __iter__(self) -> Iterator[T]:\n for i in self.a:\n \ + \ for j in i:\n yield j\n\n\n def __reversed__(self) ->\ + \ Iterator[T]:\n for i in reversed(self.a):\n for j in reversed(i):\n\ + \ yield j\n\n\n def __len__(self) -> int:\n return self.size\n\ + \n\n def __repr__(self) -> str:\n return \"SortedSet\" + str(self.a)\n\ + \n\n def __str__(self) -> str:\n s = str(list(self))\n return\ + \ \"{\" + s[1 : len(s) - 1] + \"}\"\n\n\n def _find_bucket(self, x: T) -> List[T]:\n\ + \ \"Find the bucket which should contain x. self must not be empty.\"\n\ + \ for a in self.a:\n if x <= a[-1]:\n return\ + \ a\n \n return a\n\n\n def __contains__(self, x: T) -> bool:\n \ + \ if self.size == 0:\n return False\n\n a = self._find_bucket(x)\n\ + \ i = bisect_left(a, x)\n\n return i != len(a) and a[i] == x\n\n\ + \n def add(self, x: T) -> bool:\n \"Add an element and return True if\ + \ added. / O(\u221AN)\"\n if self.size == 0:\n self.a = [[x]]\n\ + \ self.size = 1\n return True\n\n a = self._find_bucket(x)\n\ + \ i = bisect_left(a, x)\n\n if i != len(a) and a[i] == x: \n \ + \ return False\n\n a.insert(i, x)\n self.size += 1\n \ + \ if len(a) > len(self.a) * self.REBUILD_RATIO:\n self._build()\n\ + \n return True\n\n\n def discard(self, x: T) -> bool:\n \"Remove\ + \ an element and return True if removed. / O(\u221AN)\"\n if self.size\ + \ == 0:\n return False\n\n a = self._find_bucket(x)\n \ + \ i = bisect_left(a, x)\n\n if i == len(a) or a[i] != x:\n \ + \ return False\n\n a.pop(i)\n self.size -= 1\n\n if len(a)\ + \ == 0:\n self._build()\n\n return True\n\n \n def lt(self,\ + \ x: T) -> Union[T, None]:\n \"Find the largest element < x, or None if\ + \ it doesn't exist.\"\n for a in reversed(self.a):\n if a[0]\ + \ < x:\n return a[bisect_left(a, x) - 1]\n\n\n def le(self,\ + \ x: T) -> Union[T, None]:\n \"Find the largest element <= x, or None if\ + \ it doesn't exist.\"\n for a in reversed(self.a):\n if a[0]\ + \ <= x:\n return a[bisect_right(a, x) - 1]\n\n\n def gt(self,\ + \ x: T) -> Union[T, None]:\n \"Find the smallest element > x, or None if\ + \ it doesn't exist.\"\n for a in self.a:\n if a[-1] > x:\n \ + \ return a[bisect_right(a, x)]\n\n\n def ge(self, x: T) -> Union[T,\ + \ None]:\n \"Find the smallest element >= x, or None if it doesn't exist.\"\ + \n for a in self.a:\n if a[-1] >= x:\n return\ + \ a[bisect_left(a, x)]\n\n\n def __getitem__(self, x: int) -> T:\n \"\ + Return the x-th element, or IndexError if it doesn't exist.\"\n if x <\ + \ 0:\n x += self.size\n\n if x < 0:\n raise IndexError\n\ + \n for a in self.a:\n if x < len(a):\n return\ + \ a[x]\n x -= len(a)\n\n raise IndexError\n\n\n def index(self,\ + \ x: T) -> int:\n \"Count the number of elements < x.\"\n ans =\ + \ 0\n for a in self.a:\n if a[-1] >= x:\n return\ + \ ans + bisect_left(a, x)\n ans += len(a)\n\n return ans\n\n\ + \n def index_right(self, x: T) -> int:\n \"Count the number of elements\ + \ <= x.\"\n ans = 0\n for a in self.a:\n if a[-1] > x:\n\ + \ return ans + bisect_right(a, x)\n ans += len(a)\n\n\ + \ return ans" + dependsOn: [] + isVerificationFile: false + path: Math/SortedSet.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/SortedSet.py +layout: document +redirect_from: +- /library/Math/SortedSet.py +- /library/Math/SortedSet.py.html +title: Math/SortedSet.py +--- diff --git a/Math/XorToN.py b/Math/XorToN.py deleted file mode 100644 index be76bc7..0000000 --- a/Math/XorToN.py +++ /dev/null @@ -1,16 +0,0 @@ -def XorToN(N: int) -> int: - "0 〜 N までの XOR の値を返す関数" - - if N % 4 == 0: - return N - - if N % 4 == 1: - return 1 - - if N % 4 == 2: - return N + 1 - - if N % 4 == 3: - return 0 - -print(XorToN(196)) \ No newline at end of file diff --git a/Math/XorToN.py.md b/Math/XorToN.py.md new file mode 100644 index 0000000..1133ba2 --- /dev/null +++ b/Math/XorToN.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def XorToN(N: int) -> int:\n \"0 \u301C N \u307E\u3067\u306E XOR \u306E\ + \u5024\u3092\u8FD4\u3059\u95A2\u6570\"\n \n if N % 4 == 0:\n return\ + \ N\n \n if N % 4 == 1:\n return 1\n \n if N % 4 == 2:\n \ + \ return N + 1\n \n if N % 4 == 3:\n return 0\n\nprint(XorToN(196))" + dependsOn: [] + isVerificationFile: false + path: Math/XorToN.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/XorToN.py +layout: document +redirect_from: +- /library/Math/XorToN.py +- /library/Math/XorToN.py.html +title: Math/XorToN.py +--- diff --git a/Math/doubling.py b/Math/doubling.py deleted file mode 100644 index c9fbf04..0000000 --- a/Math/doubling.py +++ /dev/null @@ -1,42 +0,0 @@ -class Doubling(): - def __init__(self, n, k_max, f) -> None: - """要素数nのダブリングテーブルを作成します。""" - - k_bits = k_max.bit_length() - - # dub[i][j] = 値jを2**i回操作した結果 - dub = [[0] * n for _ in range(k_bits)] - - # 1回(2**0回)操作した結果を作成 - for j in range(n): - dub[0][j] = f(j) - - # 2**i回操作した結果を順に作成 - # 2**(i-1)回操作を2回すれば2**i回操作したことになる - for i in range(1, k_bits): - for j in range(n): - dub[i][j] = dub[i - 1][dub[i - 1][j]] - - self.doubling_table = dub - - def get(self, x, k): - """xをk回操作した値を取得します。""" - # kをビットごとに分解して、2**a + 2**b + 2**c + ... の形で考える。 - # xを2**a回操作した結果を2**b回操作した結果を2**c回操作… のように順に適用する - now = x - for i in range(k.bit_length()): - if k>>i & 1: - now = self.doubling_table[i][now] - - return now - -def calc(): - "関数を定義する" - return - -n, k = map(int,input().split()) -# nの最大値, k回, 関数 -dub = Doubling(10 ** 5, k, calc) - -# nをk回繰り返した先 -print(dub.get(n, k)) \ No newline at end of file diff --git a/Math/doubling.py.md b/Math/doubling.py.md new file mode 100644 index 0000000..4fb71c2 --- /dev/null +++ b/Math/doubling.py.md @@ -0,0 +1,53 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "class Doubling():\n def __init__(self, n, k_max, f) -> None:\n \ + \ \"\"\"\u8981\u7D20\u6570n\u306E\u30C0\u30D6\u30EA\u30F3\u30B0\u30C6\u30FC\u30D6\ + \u30EB\u3092\u4F5C\u6210\u3057\u307E\u3059\u3002\"\"\"\n\n k_bits = k_max.bit_length()\n\ + \n # dub[i][j] = \u5024j\u30922**i\u56DE\u64CD\u4F5C\u3057\u305F\u7D50\u679C\ + \n dub = [[0] * n for _ in range(k_bits)]\n\n # 1\u56DE(2**0\u56DE\ + )\u64CD\u4F5C\u3057\u305F\u7D50\u679C\u3092\u4F5C\u6210\n for j in range(n):\n\ + \ dub[0][j] = f(j)\n\n # 2**i\u56DE\u64CD\u4F5C\u3057\u305F\u7D50\ + \u679C\u3092\u9806\u306B\u4F5C\u6210\n # 2**(i-1)\u56DE\u64CD\u4F5C\u3092\ + 2\u56DE\u3059\u308C\u30702**i\u56DE\u64CD\u4F5C\u3057\u305F\u3053\u3068\u306B\u306A\ + \u308B\n for i in range(1, k_bits):\n for j in range(n):\n \ + \ dub[i][j] = dub[i - 1][dub[i - 1][j]]\n\n self.doubling_table\ + \ = dub\n\n def get(self, x, k):\n \"\"\"x\u3092k\u56DE\u64CD\u4F5C\u3057\ + \u305F\u5024\u3092\u53D6\u5F97\u3057\u307E\u3059\u3002\"\"\"\n # k\u3092\ + \u30D3\u30C3\u30C8\u3054\u3068\u306B\u5206\u89E3\u3057\u3066\u30012**a + 2**b\ + \ + 2**c + ... \u306E\u5F62\u3067\u8003\u3048\u308B\u3002\n # x\u30922**a\u56DE\ + \u64CD\u4F5C\u3057\u305F\u7D50\u679C\u30922**b\u56DE\u64CD\u4F5C\u3057\u305F\u7D50\ + \u679C\u30922**c\u56DE\u64CD\u4F5C\u2026 \u306E\u3088\u3046\u306B\u9806\u306B\u9069\ + \u7528\u3059\u308B\n now = x\n for i in range(k.bit_length()):\n\ + \ if k>>i & 1:\n now = self.doubling_table[i][now]\n\ + \n return now\n\ndef calc():\n \"\u95A2\u6570\u3092\u5B9A\u7FA9\u3059\ + \u308B\"\n return\n\nn, k = map(int,input().split())\n# n\u306E\u6700\u5927\ + \u5024, k\u56DE, \u95A2\u6570\ndub = Doubling(10 ** 5, k, calc)\n\n# n\u3092k\u56DE\ + \u7E70\u308A\u8FD4\u3057\u305F\u5148\nprint(dub.get(n, k))" + dependsOn: [] + isVerificationFile: false + path: Math/doubling.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/doubling.py +layout: document +redirect_from: +- /library/Math/doubling.py +- /library/Math/doubling.py.html +title: Math/doubling.py +--- diff --git a/Math/nCk.py b/Math/nCk.py deleted file mode 100644 index b6c3bf7..0000000 --- a/Math/nCk.py +++ /dev/null @@ -1,36 +0,0 @@ -def calc_facinv(n: int) -> list: - '逆元テーブルを作成する' - - # 階乗テーブルの作成 - fac = [0] * (n + 1) - fac[0] = 1 - for i in range(1, n + 1): - fac[i] = fac[i - 1] * i - fac[i] %= mod - - # 逆元テーブルの作成 - fac_inv = [0] * (n + 1) - fac_inv[0] = 1 - for i in range(1, n + 1): - fac_inv[i] = pow(fac[i], mod - 2, mod) - - return fac, fac_inv - -def combination(n: int, k: int) -> int: - '''nCkを計算する''' - - return fac[n] * fac_inv[k] * fac_inv[n - k] % mod - -def main() -> None: - - n, k = map(int, input().split()) - - mod = 10 ** 9 + 7 - fac, fac_inv = calc_facinv(n) - - ans = combination(n, k) - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Math/nCk.py.md b/Math/nCk.py.md new file mode 100644 index 0000000..e1738cb --- /dev/null +++ b/Math/nCk.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def calc_facinv(n: int) -> list:\n '\u9006\u5143\u30C6\u30FC\u30D6\u30EB\ + \u3092\u4F5C\u6210\u3059\u308B'\n\n # \u968E\u4E57\u30C6\u30FC\u30D6\u30EB\u306E\ + \u4F5C\u6210\n fac = [0] * (n + 1)\n fac[0] = 1\n for i in range(1, n\ + \ + 1):\n fac[i] = fac[i - 1] * i\n fac[i] %= mod\n \n # \u9006\ + \u5143\u30C6\u30FC\u30D6\u30EB\u306E\u4F5C\u6210\n fac_inv = [0] * (n + 1)\n\ + \ fac_inv[0] = 1\n for i in range(1, n + 1):\n fac_inv[i] = pow(fac[i],\ + \ mod - 2, mod)\n \n return fac, fac_inv\n\ndef combination(n: int, k: int)\ + \ -> int:\n '''nCk\u3092\u8A08\u7B97\u3059\u308B'''\n\n return fac[n] *\ + \ fac_inv[k] * fac_inv[n - k] % mod\n\ndef main() -> None:\n\n n, k = map(int,\ + \ input().split())\n\n mod = 10 ** 9 + 7\n fac, fac_inv = calc_facinv(n)\n\ + \n ans = combination(n, k)\n print(ans)\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: false + path: Math/nCk.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/nCk.py +layout: document +redirect_from: +- /library/Math/nCk.py +- /library/Math/nCk.py.html +title: Math/nCk.py +--- diff --git a/Math/nCkFactorization.py b/Math/nCkFactorization.py deleted file mode 100644 index 974d35c..0000000 --- a/Math/nCkFactorization.py +++ /dev/null @@ -1,49 +0,0 @@ -def primes_list(n): - """エラトステネスの篩でn以下の素数を全列挙する""" - if n == 0: - return [] - is_prime = [True] * (n + 1) - is_prime[0] = False - is_prime[1] = False - for i in range(2, int(n ** 0.5) + 1): - if not is_prime[i]: continue - for j in range(i * 2, n + 1, i): - is_prime[j] = False - return [i for i in range(n + 1) if is_prime[i]] - -def nCkFactorization(n: int, k: int) -> list: - """nCkの 1,2,...,k, n,n-1,...,n-k+1を全て素因数分解する""" - - # 分子 - divisors_1 = [[] for _ in range(k)] - a = [n - i for i in range(k)] - num = primes_list(int(n ** 0.5) + 1) - - for p in num: - for i in reversed(range(n - k + 1 + p - (n - k + 1) % p if (n - k + 1) % p != 0 else n - k + 1, n + 1, p)): - while a[n - i] % p == 0: - divisors_1[n - i].append(p) - a[n - i] //= p - - for i in range(len(a)): - if a[i] != 1: - divisors_1[i].append(a[i]) - - # 分母 - divisors_2 = [[] for _ in range(k + 1)] - a = [i for i in range(k + 1)] - num = primes_list(k) # 素数の全列挙 - - for p in num: - for i in range(p, k + 1, p): - while a[i] % p == 0: - divisors_2[i].append(p) - a[i] //= p - - return divisors_1, divisors_2 - -x, y = nCkFactorization(100, 30) -print("分子") -print(*x, sep="\n") -print("分母") -print(*y, sep="\n") \ No newline at end of file diff --git a/Math/nCkFactorization.py.md b/Math/nCkFactorization.py.md new file mode 100644 index 0000000..9e8f3cb --- /dev/null +++ b/Math/nCkFactorization.py.md @@ -0,0 +1,51 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def primes_list(n):\n \"\"\"\u30A8\u30E9\u30C8\u30B9\u30C6\u30CD\u30B9\ + \u306E\u7BE9\u3067n\u4EE5\u4E0B\u306E\u7D20\u6570\u3092\u5168\u5217\u6319\u3059\ + \u308B\"\"\"\n if n == 0:\n return []\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]: continue\n for j in\ + \ range(i * 2, n + 1, i):\n is_prime[j] = False\n return [i for\ + \ i in range(n + 1) if is_prime[i]]\n\ndef nCkFactorization(n: int, k: int) ->\ + \ list:\n \"\"\"nCk\u306E 1,2,...,k, n,n-1,...,n-k+1\u3092\u5168\u3066\u7D20\ + \u56E0\u6570\u5206\u89E3\u3059\u308B\"\"\"\n\n # \u5206\u5B50\n divisors_1\ + \ = [[] for _ in range(k)]\n a = [n - i for i in range(k)]\n num = primes_list(int(n\ + \ ** 0.5) + 1)\n\n for p in num:\n for i in reversed(range(n - k + 1\ + \ + p - (n - k + 1) % p if (n - k + 1) % p != 0 else n - k + 1, n + 1, p)):\n\ + \ while a[n - i] % p == 0:\n divisors_1[n - i].append(p)\n\ + \ a[n - i] //= p\n\n for i in range(len(a)):\n if a[i]\ + \ != 1:\n divisors_1[i].append(a[i])\n\n # \u5206\u6BCD\n divisors_2\ + \ = [[] for _ in range(k + 1)]\n a = [i for i in range(k + 1)]\n num = primes_list(k)\ + \ # \u7D20\u6570\u306E\u5168\u5217\u6319\n \n for p in num:\n for\ + \ i in range(p, k + 1, p):\n while a[i] % p == 0:\n \ + \ divisors_2[i].append(p)\n a[i] //= p\n \n return divisors_1,\ + \ divisors_2\n\nx, y = nCkFactorization(100, 30)\nprint(\"\u5206\u5B50\")\nprint(*x,\ + \ sep=\"\\n\")\nprint(\"\u5206\u6BCD\")\nprint(*y, sep=\"\\n\")" + dependsOn: [] + isVerificationFile: false + path: Math/nCkFactorization.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Math/nCkFactorization.py +layout: document +redirect_from: +- /library/Math/nCkFactorization.py +- /library/Math/nCkFactorization.py.html +title: Math/nCkFactorization.py +--- diff --git a/Other/debug.py b/Other/debug.py deleted file mode 100644 index 7e1d913..0000000 --- a/Other/debug.py +++ /dev/null @@ -1,17 +0,0 @@ -import sys -debug = lambda *x : print(*x, file = sys.stderr) - -""" -これを使用すると、標準エラー出力になるので、printしてもジャッジに反映されない -""" - -a = [1, 2, 3, 4, 5] -word = "ryusuke" -debug(a, word) - - -A, B, C = map(int, input().split()) -if A ** 2 + B ** 2 < C ** 2: - print("Yes") -else: - print("No") \ No newline at end of file diff --git a/Other/debug.py.md b/Other/debug.py.md new file mode 100644 index 0000000..da47dc5 --- /dev/null +++ b/Other/debug.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\ndebug = lambda *x : print(*x, file = sys.stderr)\n\n\"\"\"\n\u3053\ + \u308C\u3092\u4F7F\u7528\u3059\u308B\u3068\u3001\u6A19\u6E96\u30A8\u30E9\u30FC\ + \u51FA\u529B\u306B\u306A\u308B\u306E\u3067\u3001print\u3057\u3066\u3082\u30B8\u30E3\ + \u30C3\u30B8\u306B\u53CD\u6620\u3055\u308C\u306A\u3044\n\"\"\"\n\na = [1, 2, 3,\ + \ 4, 5]\nword = \"ryusuke\"\ndebug(a, word)\n\n\nA, B, C = map(int, input().split())\n\ + if A ** 2 + B ** 2 < C ** 2:\n print(\"Yes\")\nelse:\n print(\"No\")" + dependsOn: [] + isVerificationFile: false + path: Other/debug.py + requiredBy: [] + timestamp: '2022-08-11 01:40:44+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Other/debug.py +layout: document +redirect_from: +- /library/Other/debug.py +- /library/Other/debug.py.html +title: Other/debug.py +--- diff --git a/Search/BinarySearch.py b/Search/BinarySearch.py deleted file mode 100644 index e581d69..0000000 --- a/Search/BinarySearch.py +++ /dev/null @@ -1,15 +0,0 @@ -def check(arg): - if 1: - return True - else: - return False - -def binary_search(left: int, right: int) -> int: - while right - left > 1: - mid = (left + right) // 2 - if check(mid): - left = mid - else: - right = mid - - return left \ No newline at end of file diff --git a/Search/BinarySearch.py.md b/Search/BinarySearch.py.md new file mode 100644 index 0000000..bf36a53 --- /dev/null +++ b/Search/BinarySearch.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def check(arg):\n if 1:\n return True\n else:\n return\ + \ False\n\ndef binary_search(left: int, right: int) -> int:\n while right -\ + \ left > 1:\n mid = (left + right) // 2\n if check(mid):\n \ + \ left = mid\n else:\n right = mid\n\n return left" + dependsOn: [] + isVerificationFile: false + path: Search/BinarySearch.py + requiredBy: [] + timestamp: '2022-08-09 16:25:06+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Search/BinarySearch.py +layout: document +redirect_from: +- /library/Search/BinarySearch.py +- /library/Search/BinarySearch.py.html +title: Search/BinarySearch.py +--- diff --git a/Search/BitSearch.py b/Search/BitSearch.py deleted file mode 100644 index ccd3492..0000000 --- a/Search/BitSearch.py +++ /dev/null @@ -1,8 +0,0 @@ -from itertools import product - -def BitSearch(x, l): # リスト・数 - num = 0 - for i in product([0, 1], repeat = l): - for j in range(l): - if i[j] == 1: # 1 <-> bitが立っている時 - # O(1) \ No newline at end of file diff --git a/Search/BitSearch.py.md b/Search/BitSearch.py.md new file mode 100644 index 0000000..3477127 --- /dev/null +++ b/Search/BitSearch.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from itertools import product\n\ndef BitSearch(x, l): # \u30EA\u30B9\u30C8\ + \u30FB\u6570\n num = 0\n for i in product([0, 1], repeat = l):\n \ + \ for j in range(l):\n if i[j] == 1: # 1 <-> bit\u304C\u7ACB\u3063\u3066\ + \u3044\u308B\u6642\n # O(1)" + dependsOn: [] + isVerificationFile: false + path: Search/BitSearch.py + requiredBy: [] + timestamp: '2022-02-06 18:58:27+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Search/BitSearch.py +layout: document +redirect_from: +- /library/Search/BitSearch.py +- /library/Search/BitSearch.py.html +title: Search/BitSearch.py +--- diff --git a/Search/BreadthFirstSearch_graph.py b/Search/BreadthFirstSearch_graph.py deleted file mode 100644 index 0f88411..0000000 --- a/Search/BreadthFirstSearch_graph.py +++ /dev/null @@ -1,36 +0,0 @@ -from collections import deque - -def bfs(n: int, g:list, s: int) -> list: - n = len(g) - INF = float('inf') - dist = [INF] * n - dist[s] = 0 - - q = deque() - q.append(s) - - while q: - prev = q.popleft() - for nxt in g[prev]: - if dist[nxt] != INF: continue - dist[nxt] = dist[prev] + 1 - q.append(nxt) - - - return dist - -def main() -> None: - n = int(input()) - - g = [[] for _ in range(n)] - for _ in range(n - 1): - u, v = map(lambda x: int(x) - 1, input().split()) - g[u].append(v) - g[v].append(u) - - bfs(0, g) - - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Search/BreadthFirstSearch_graph.py.md b/Search/BreadthFirstSearch_graph.py.md new file mode 100644 index 0000000..959dcf5 --- /dev/null +++ b/Search/BreadthFirstSearch_graph.py.md @@ -0,0 +1,39 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from collections import deque\n\ndef bfs(n: int, g:list, s: int) -> list:\n\ + \ n = len(g)\n INF = float('inf')\n dist = [INF] * n\n dist[s] = 0\n\ + \ \n q = deque()\n q.append(s)\n\n while q:\n prev = q.popleft()\n\ + \ for nxt in g[prev]:\n if dist[nxt] != INF: continue\n \ + \ dist[nxt] = dist[prev] + 1\n q.append(nxt)\n\n\n return\ + \ dist\n\ndef main() -> None:\n n = int(input())\n\n g = [[] for _ in range(n)]\n\ + \ for _ in range(n - 1):\n u, v = map(lambda x: int(x) - 1, input().split())\n\ + \ g[u].append(v)\n g[v].append(u)\n\n bfs(0, g)\n\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Search/BreadthFirstSearch_graph.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Search/BreadthFirstSearch_graph.py +layout: document +redirect_from: +- /library/Search/BreadthFirstSearch_graph.py +- /library/Search/BreadthFirstSearch_graph.py.html +title: Search/BreadthFirstSearch_graph.py +--- diff --git a/Search/BreadthFirstSearch_grid.py b/Search/BreadthFirstSearch_grid.py deleted file mode 100644 index 6ce8aea..0000000 --- a/Search/BreadthFirstSearch_grid.py +++ /dev/null @@ -1,33 +0,0 @@ -from collections import deque - -def bfs(sy: int, sx: int, dist: list) -> list: - INF = float('inf') - d = ((0, 1), (0, -1), (1, 0), (-1, 0)) - q = deque() - q.append((sy, sx)) - - while q: - vy, vx = q.popleft() - for dy, dx in d: - y = vy + dy - x = vx + dx - if not (0 <= x < w and 0 <= y < h):continue - if grid[y][x] == '#': continue - if dist[y][x] != INF: continue - dist[y][x] = dist[vy][vx] + 1 - q.append((y, x)) - - - return dist - -def main() -> None: - global h, w, grid - - h, w = map(int, input().split()) - grid = [list(input()) for _ in range(h)] - - dist = bfs(0, 0) - print(*dist, sep='\n') - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Search/BreadthFirstSearch_grid.py.md b/Search/BreadthFirstSearch_grid.py.md new file mode 100644 index 0000000..3a96107 --- /dev/null +++ b/Search/BreadthFirstSearch_grid.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from collections import deque\n\ndef bfs(sy: int, sx: int, dist: list) ->\ + \ list:\n INF = float('inf')\n d = ((0, 1), (0, -1), (1, 0), (-1, 0))\n\ + \ q = deque()\n q.append((sy, sx))\n\n while q:\n vy, vx = q.popleft()\n\ + \ for dy, dx in d:\n y = vy + dy\n x = vx + dx\n\ + \ if not (0 <= x < w and 0 <= y < h):continue\n if grid[y][x]\ + \ == '#': continue\n if dist[y][x] != INF: continue\n dist[y][x]\ + \ = dist[vy][vx] + 1\n q.append((y, x))\n\n\n return dist\n\ndef\ + \ main() -> None:\n global h, w, grid\n\n h, w = map(int, input().split())\n\ + \ grid = [list(input()) for _ in range(h)]\n\n dist = bfs(0, 0)\n print(*dist,\ + \ sep='\\n')\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Search/BreadthFirstSearch_grid.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Search/BreadthFirstSearch_grid.py +layout: document +redirect_from: +- /library/Search/BreadthFirstSearch_grid.py +- /library/Search/BreadthFirstSearch_grid.py.html +title: Search/BreadthFirstSearch_grid.py +--- diff --git a/String/BoyerMoore.py b/String/BoyerMoore.py deleted file mode 100644 index 4a66fdc..0000000 --- a/String/BoyerMoore.py +++ /dev/null @@ -1,34 +0,0 @@ -from collections import defaultdict - -def BoyerMoore(s: str, t: str) -> bool: - '''文字列 s の中に t が存在するかを判別する''' - skip_table = defaultdict(lambda : -1) - for i, j in enumerate(t[::-1]): - if skip_table[j] == -1: - skip_table[j] = i - - l_s = len(s) - l_t = len(t) - - if l_s < l_t: - return False - else: - i = l_t - 1 - cnt = 0 - while i < l_s: - if s[i] == t[-1 - cnt]: - cnt += 1 - i -= 1 - else: - i += l_t if skip_table[s[i]] == -1 else skip_table[s[i]] - cnt = 0 - - if cnt == l_t: - print(f'[{i + 1}, {i + l_t}] の区間に {t} が見つかりました。') - return True - - return False - -s = 'abcdefghijklmnopqrstuvwxyz' -t = 'def' -print(BoyerMoore(s, t)) \ No newline at end of file diff --git a/String/BoyerMoore.py.md b/String/BoyerMoore.py.md new file mode 100644 index 0000000..5ba5730 --- /dev/null +++ b/String/BoyerMoore.py.md @@ -0,0 +1,43 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "from collections import defaultdict\n\ndef BoyerMoore(s: str, t: str) ->\ + \ bool:\n '''\u6587\u5B57\u5217 s \u306E\u4E2D\u306B t \u304C\u5B58\u5728\u3059\ + \u308B\u304B\u3092\u5224\u5225\u3059\u308B'''\n skip_table = defaultdict(lambda\ + \ : -1)\n for i, j in enumerate(t[::-1]):\n if skip_table[j] == -1:\n\ + \ skip_table[j] = i\n \n l_s = len(s)\n l_t = len(t)\n\n \ + \ if l_s < l_t:\n return False\n else:\n i = l_t - 1\n \ + \ cnt = 0\n while i < l_s:\n if s[i] == t[-1 - cnt]:\n \ + \ cnt += 1\n i -= 1\n else:\n \ + \ i += l_t if skip_table[s[i]] == -1 else skip_table[s[i]]\n \ + \ cnt = 0\n\n if cnt == l_t:\n print(f'[{i + 1},\ + \ {i + l_t}] \u306E\u533A\u9593\u306B {t} \u304C\u898B\u3064\u304B\u308A\u307E\ + \u3057\u305F\u3002')\n return True\n \n return False\n\ + \ns = 'abcdefghijklmnopqrstuvwxyz'\nt = 'def'\nprint(BoyerMoore(s, t))" + dependsOn: [] + isVerificationFile: false + path: String/BoyerMoore.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: String/BoyerMoore.py +layout: document +redirect_from: +- /library/String/BoyerMoore.py +- /library/String/BoyerMoore.py.html +title: String/BoyerMoore.py +--- diff --git a/String/CoordinateCompression.py b/String/CoordinateCompression.py deleted file mode 100644 index 102f5fb..0000000 --- a/String/CoordinateCompression.py +++ /dev/null @@ -1,8 +0,0 @@ -def CC(A: list) -> list: - "座標圧縮" - B = {j: i + 1 for i, j in enumerate(sorted(set(A)))} - return B - -x = [2, 5, 1, 21, 312, 23, 21] -ans = CC(x) -print(ans) \ No newline at end of file diff --git a/String/CoordinateCompression.py.md b/String/CoordinateCompression.py.md new file mode 100644 index 0000000..bf9a25a --- /dev/null +++ b/String/CoordinateCompression.py.md @@ -0,0 +1,33 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def CC(A: list) -> list:\n \"\u5EA7\u6A19\u5727\u7E2E\"\n B = {j: i\ + \ + 1 for i, j in enumerate(sorted(set(A)))}\n return B\n\nx = [2, 5, 1, 21,\ + \ 312, 23, 21]\nans = CC(x)\nprint(ans)" + dependsOn: [] + isVerificationFile: false + path: String/CoordinateCompression.py + requiredBy: [] + timestamp: '2022-05-22 23:05:29+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: String/CoordinateCompression.py +layout: document +redirect_from: +- /library/String/CoordinateCompression.py +- /library/String/CoordinateCompression.py.html +title: String/CoordinateCompression.py +--- diff --git a/String/RunLengthEncoding.py b/String/RunLengthEncoding.py deleted file mode 100644 index 6123e1c..0000000 --- a/String/RunLengthEncoding.py +++ /dev/null @@ -1,16 +0,0 @@ -def RLE(S: str) -> list: - tmp, cnt, ans = S[0], 1, [] - for i in range(1, len(S)): - if tmp == S[i]: - cnt += 1 - else: - ans.append((tmp, cnt)) - tmp = S[i] - cnt = 1 - - ans.append((tmp, cnt)) - - return ans - -s = "RRRLLRLRRLLLLRLRLRR" -print(*RLE(s), sep="\n") \ No newline at end of file diff --git a/String/RunLengthEncoding.py.md b/String/RunLengthEncoding.py.md new file mode 100644 index 0000000..0c52482 --- /dev/null +++ b/String/RunLengthEncoding.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "def RLE(S: str) -> list:\n tmp, cnt, ans = S[0], 1, []\n for i in range(1,\ + \ len(S)):\n if tmp == S[i]:\n cnt += 1\n else:\n \ + \ ans.append((tmp, cnt))\n tmp = S[i]\n cnt = 1\n\ + \n ans.append((tmp, cnt))\n\n return ans\n\ns = \"RRRLLRLRRLLLLRLRLRR\"\n\ + print(*RLE(s), sep=\"\\n\")" + dependsOn: [] + isVerificationFile: false + path: String/RunLengthEncoding.py + requiredBy: [] + timestamp: '2022-05-30 00:14:54+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: String/RunLengthEncoding.py +layout: document +redirect_from: +- /library/String/RunLengthEncoding.py +- /library/String/RunLengthEncoding.py.html +title: String/RunLengthEncoding.py +--- diff --git a/Template/Template.py b/Template/Template.py deleted file mode 100644 index ced5e78..0000000 --- a/Template/Template.py +++ /dev/null @@ -1,62 +0,0 @@ -import sys -input = sys.stdin.readline -sys.setrecursionlimit(10 ** 6) -printd = lambda *x : print(*x, file = sys.stderr) - -from math import ceil, floor, sin, cos, tan, acos, asin, atan, radians, factorial, exp, degrees -from collections import defaultdict, deque, Counter -from itertools import product, permutations, combinations, combinations_with_replacement -from heapq import heapify, heappop, heappush -from bisect import bisect, bisect_left, bisect_right - - -def min_int(a: int, b: int) -> int: - "2数の最小値" - return a if a <= b else b - - -def min_list(a: list) -> int: - "リストの最小値" - global INF - cnt = INF - for i in range(len(a)): - if a[i] < cnt: - cnt = a[i] - - return cnt - - -def min_list(a: list) -> int: - "リストの最大値" - global INF - cnt = -INF - for i in range(len(a)): - if a[i] > cnt: - cnt = a[i] - - return cnt - - -def max_int(a: int, b: int) -> int: - "2数の最大値" - return a if a >= b else b - - -def OutOfRange(h: int, w: int, vy: int, vx: int) -> bool: - "BFSなどの配列外参照" - d = ((1, 0), (-1, 0), (0, 1), (0, -1)) - for dy, dx in d: - y = vy + dy - x = vx + dx - if not (0 <= x < w and 0 <= y < h): - return False - else: - return True - - -def main() -> None: - INF = 10 ** 18 - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/Template/Template.py.md b/Template/Template.py.md new file mode 100644 index 0000000..8c5754a --- /dev/null +++ b/Template/Template.py.md @@ -0,0 +1,50 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\ninput = sys.stdin.readline\nsys.setrecursionlimit(10 ** 6)\n\ + printd = lambda *x : print(*x, file = sys.stderr)\n\nfrom math import ceil, floor,\ + \ sin, cos, tan, acos, asin, atan, radians, factorial, exp, degrees\nfrom collections\ + \ import defaultdict, deque, Counter\nfrom itertools import product, permutations,\ + \ combinations, combinations_with_replacement\nfrom heapq import heapify, heappop,\ + \ heappush\nfrom bisect import bisect, bisect_left, bisect_right\n\n\ndef min_int(a:\ + \ int, b: int) -> int:\n \"2\u6570\u306E\u6700\u5C0F\u5024\"\n return a\ + \ if a <= b else b\n\n\ndef min_list(a: list) -> int:\n \"\u30EA\u30B9\u30C8\ + \u306E\u6700\u5C0F\u5024\"\n global INF\n cnt = INF\n for i in range(len(a)):\n\ + \ if a[i] < cnt:\n cnt = a[i]\n\n return cnt\n\n\ndef min_list(a:\ + \ list) -> int:\n \"\u30EA\u30B9\u30C8\u306E\u6700\u5927\u5024\"\n global\ + \ INF\n cnt = -INF\n for i in range(len(a)):\n if a[i] > cnt:\n \ + \ cnt = a[i]\n\n return cnt\n\n\ndef max_int(a: int, b: int) -> int:\n\ + \ \"2\u6570\u306E\u6700\u5927\u5024\"\n return a if a >= b else b\n\n\n\ + def OutOfRange(h: int, w: int, vy: int, vx: int) -> bool:\n \"BFS\u306A\u3069\ + \u306E\u914D\u5217\u5916\u53C2\u7167\"\n d = ((1, 0), (-1, 0), (0, 1), (0,\ + \ -1))\n for dy, dx in d:\n y = vy + dy\n x = vx + dx\n \ + \ if not (0 <= x < w and 0 <= y < h):\n return False\n else:\n\ + \ return True\n\n\ndef main() -> None:\n INF = 10 ** 18\n\n\nif\ + \ __name__ == '__main__':\n main()" + dependsOn: [] + isVerificationFile: false + path: Template/Template.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Template/Template.py +layout: document +redirect_from: +- /library/Template/Template.py +- /library/Template/Template.py.html +title: Template/Template.py +--- diff --git a/Template/VerifyHelperTemplate.py b/Template/VerifyHelperTemplate.py deleted file mode 100644 index d4dbec9..0000000 --- a/Template/VerifyHelperTemplate.py +++ /dev/null @@ -1,16 +0,0 @@ -import sys -input = sys.stdin.readline - -from pathlib import Path - -p = Path(__file__).parts -sys.path.append('/'.join(p[:p.index('AtCoder-Library') + 1])) - -from Tree import UnionFindTree - -def main(): - pass - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Template/VerifyHelperTemplate.py.md b/Template/VerifyHelperTemplate.py.md new file mode 100644 index 0000000..42603cd --- /dev/null +++ b/Template/VerifyHelperTemplate.py.md @@ -0,0 +1,34 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "import sys\ninput = sys.stdin.readline\n\nfrom pathlib import Path\n\np =\ + \ Path(__file__).parts\nsys.path.append('/'.join(p[:p.index('AtCoder-Library')\ + \ + 1]))\n\nfrom Tree import UnionFindTree\n\ndef main():\n pass\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Template/VerifyHelperTemplate.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Template/VerifyHelperTemplate.py +layout: document +redirect_from: +- /library/Template/VerifyHelperTemplate.py +- /library/Template/VerifyHelperTemplate.py.html +title: Template/VerifyHelperTemplate.py +--- diff --git a/Test/AOJ/ALDS1/ALDS1_13_A.test.py b/Test/AOJ/ALDS1/ALDS1_13_A.test.py deleted file mode 100644 index 67bbfd0..0000000 --- a/Test/AOJ/ALDS1/ALDS1_13_A.test.py +++ /dev/null @@ -1,28 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_13_A - -from itertools import permutations - -k = int(input()) -rc = [list(map(int, input().split())) for _ in range(k)] - -for p in permutations(range(8)): - flag = True - for i, j in rc: - if p[i] != j: - flag = False - - if not flag: - continue - - for k in range(8): - for l in range(8): - if k == l: - continue - if abs(p[k] - p[l]) == abs(k - l): - flag = False - - if flag: - for i in p: - ans = ["."] * 8 - ans[i] = "Q" - print("".join(ans)) \ No newline at end of file diff --git a/Test/AOJ/ALDS1/ALDS1_13_A.test.py.md b/Test/AOJ/ALDS1/ALDS1_13_A.test.py.md new file mode 100644 index 0000000..284099d --- /dev/null +++ b/Test/AOJ/ALDS1/ALDS1_13_A.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_13_A + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_13_A + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_13_A\n\ + \nfrom itertools import permutations\n\nk = int(input())\nrc = [list(map(int,\ + \ input().split())) for _ in range(k)]\n\nfor p in permutations(range(8)):\n \ + \ flag = True\n for i, j in rc:\n if p[i] != j:\n flag\ + \ = False\n\n if not flag:\n continue\n\n for k in range(8):\n \ + \ for l in range(8):\n if k == l:\n continue\n\ + \ if abs(p[k] - p[l]) == abs(k - l):\n flag = False\n\ + \n if flag:\n for i in p:\n ans = [\".\"] * 8\n \ + \ ans[i] = \"Q\"\n print(\"\".join(ans))" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ALDS1/ALDS1_13_A.test.py + requiredBy: [] + timestamp: '2022-08-11 00:02:49+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ALDS1/ALDS1_13_A.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ALDS1/ALDS1_13_A.test.py +- /verify/Test/AOJ/ALDS1/ALDS1_13_A.test.py.html +title: Test/AOJ/ALDS1/ALDS1_13_A.test.py +--- diff --git a/Test/AOJ/ALDS1/ALDS1_1_B.test.py b/Test/AOJ/ALDS1/ALDS1_1_B.test.py deleted file mode 100644 index 469f381..0000000 --- a/Test/AOJ/ALDS1/ALDS1_1_B.test.py +++ /dev/null @@ -1,14 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B - -import sys -sys.path.append("../../../") - -from math import gcd - -def main(): - x, y = map(int, input().split()) - print(gcd(x, y)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ALDS1/ALDS1_1_B.test.py.md b/Test/AOJ/ALDS1/ALDS1_1_B.test.py.md new file mode 100644 index 0000000..f285a9e --- /dev/null +++ b/Test/AOJ/ALDS1/ALDS1_1_B.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_B\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom math import gcd\n\ndef main():\n\ + \ x, y = map(int, input().split())\n print(gcd(x, y))\n\n\nif __name__ ==\ + \ \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ALDS1/ALDS1_1_B.test.py + requiredBy: [] + timestamp: '2022-08-11 00:02:49+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ALDS1/ALDS1_1_B.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ALDS1/ALDS1_1_B.test.py +- /verify/Test/AOJ/ALDS1/ALDS1_1_B.test.py.html +title: Test/AOJ/ALDS1/ALDS1_1_B.test.py +--- diff --git a/Test/AOJ/ALDS1/ALDS1_1_C.test.py b/Test/AOJ/ALDS1/ALDS1_1_C.test.py deleted file mode 100644 index 25103d9..0000000 --- a/Test/AOJ/ALDS1/ALDS1_1_C.test.py +++ /dev/null @@ -1,19 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C - -import sys -sys.path.append("../../../") - -from Math import PrimaryCheck - -def main() -> None: - ans = 0 - - n = int(input()) - for _ in range(n): - ans += int(PrimaryCheck.PrimaryCheck(int(input()))) - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ALDS1/ALDS1_1_C.test.py.md b/Test/AOJ/ALDS1/ALDS1_1_C.test.py.md new file mode 100644 index 0000000..12dadc7 --- /dev/null +++ b/Test/AOJ/ALDS1/ALDS1_1_C.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/PrimaryCheck.py + title: Math/PrimaryCheck.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import PrimaryCheck\n\ + \ndef main() -> None:\n ans = 0\n\n n = int(input())\n for _ in range(n):\n\ + \ ans += int(PrimaryCheck.PrimaryCheck(int(input())))\n \n print(ans)\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/PrimaryCheck.py + isVerificationFile: true + path: Test/AOJ/ALDS1/ALDS1_1_C.test.py + requiredBy: [] + timestamp: '2023-06-29 17:50:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ALDS1/ALDS1_1_C.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ALDS1/ALDS1_1_C.test.py +- /verify/Test/AOJ/ALDS1/ALDS1_1_C.test.py.html +title: Test/AOJ/ALDS1/ALDS1_1_C.test.py +--- diff --git a/Test/AOJ/ALDS1/ALDS1_4_B.test.py b/Test/AOJ/ALDS1/ALDS1_4_B.test.py deleted file mode 100644 index ea973f9..0000000 --- a/Test/AOJ/ALDS1/ALDS1_4_B.test.py +++ /dev/null @@ -1,13 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B - -def main(): - n = int(input()) - s = set(list(map(int, input().split()))) - q = int(input()) - t = set(list(map(int, input().split()))) - - print(len(s & t)) - - -if __name__ == "__main__": - main() diff --git a/Test/AOJ/ALDS1/ALDS1_4_B.test.py.md b/Test/AOJ/ALDS1/ALDS1_4_B.test.py.md new file mode 100644 index 0000000..4288b93 --- /dev/null +++ b/Test/AOJ/ALDS1/ALDS1_4_B.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B\n\ + \ndef main():\n n = int(input())\n s = set(list(map(int, input().split())))\n\ + \ q = int(input())\n t = set(list(map(int, input().split())))\n \n \ + \ print(len(s & t))\n\n\nif __name__ == \"__main__\":\n main()\n" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ALDS1/ALDS1_4_B.test.py + requiredBy: [] + timestamp: '2023-06-30 09:12:08+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ALDS1/ALDS1_4_B.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ALDS1/ALDS1_4_B.test.py +- /verify/Test/AOJ/ALDS1/ALDS1_4_B.test.py.html +title: Test/AOJ/ALDS1/ALDS1_4_B.test.py +--- diff --git a/Test/AOJ/ALDS1/ALDS1_5_D.test.py b/Test/AOJ/ALDS1/ALDS1_5_D.test.py deleted file mode 100644 index c702651..0000000 --- a/Test/AOJ/ALDS1/ALDS1_5_D.test.py +++ /dev/null @@ -1,19 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_D - -import sys -sys.path.append("../../../") - -from Tree import BinaryIndexedTree -import copy - - -def main(): - n = int(input()) - a = list(map(int, input().split())) - - x = copy.copy(a) - print(BinaryIndexedTree.BIT(x)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ALDS1/ALDS1_5_D.test.py.md b/Test/AOJ/ALDS1/ALDS1_5_D.test.py.md new file mode 100644 index 0000000..2cdc667 --- /dev/null +++ b/Test/AOJ/ALDS1/ALDS1_5_D.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_D + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_D + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_D\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Tree import BinaryIndexedTree\n\ + import copy\n\n\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n\ + \n x = copy.copy(a)\n print(BinaryIndexedTree.BIT(x))\n\n\nif __name__ ==\ + \ \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ALDS1/ALDS1_5_D.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ALDS1/ALDS1_5_D.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ALDS1/ALDS1_5_D.test.py +- /verify/Test/AOJ/ALDS1/ALDS1_5_D.test.py.html +title: Test/AOJ/ALDS1/ALDS1_5_D.test.py +--- diff --git a/Test/AOJ/DSL/DSL_1_A.test.py b/Test/AOJ/DSL/DSL_1_A.test.py deleted file mode 100644 index 098f040..0000000 --- a/Test/AOJ/DSL/DSL_1_A.test.py +++ /dev/null @@ -1,22 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A - -import sys -sys.path.append("../../../") - -from Tree import UnionFindTree - -def main(): - n, q = map(int, input().split()) - - uf = UnionFindTree.UnionFind(n) - - for _ in range(q): - com, x, y = map(int, input().split()) - if com == 0: - uf.merge(x, y) - elif com == 1: - print(int(uf.same(x, y))) - - -if __name__ == "__main__": - main() diff --git a/Test/AOJ/DSL/DSL_1_A.test.py.md b/Test/AOJ/DSL/DSL_1_A.test.py.md new file mode 100644 index 0000000..bbfef9e --- /dev/null +++ b/Test/AOJ/DSL/DSL_1_A.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Tree/UnionFindTree.py + title: Tree/UnionFindTree.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Tree import UnionFindTree\n\ + \ndef main():\n n, q = map(int, input().split())\n\n uf = UnionFindTree.UnionFind(n)\n\ + \n for _ in range(q):\n com, x, y = map(int, input().split())\n \ + \ if com == 0:\n uf.merge(x, y)\n elif com == 1:\n \ + \ print(int(uf.same(x, y)))\n\n\nif __name__ == \"__main__\":\n main()\n" + dependsOn: + - Tree/UnionFindTree.py + isVerificationFile: true + path: Test/AOJ/DSL/DSL_1_A.test.py + requiredBy: [] + timestamp: '2024-04-23 12:17:37+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/DSL/DSL_1_A.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/DSL/DSL_1_A.test.py +- /verify/Test/AOJ/DSL/DSL_1_A.test.py.html +title: Test/AOJ/DSL/DSL_1_A.test.py +--- diff --git a/Test/AOJ/GRL/GRL_1_A.test.py b/Test/AOJ/GRL/GRL_1_A.test.py deleted file mode 100644 index c722ef6..0000000 --- a/Test/AOJ/GRL/GRL_1_A.test.py +++ /dev/null @@ -1,23 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A - -import sys -sys.path.append("../../../") - -from Graph import Dijkstra - - -def main(): - V, E, r = map(int, input().split()) - g = [[] for _ in range(V)] - INF = 10**18 - for _ in range(E): - s, t, d = map(int, input().split()) - g[s].append((t, d)) - - dist = Dijkstra.dijkstra(r, g) - for i in range(V): - print(dist[i]) if dist[i] != INF else print("INF") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/GRL/GRL_1_A.test.py.md b/Test/AOJ/GRL/GRL_1_A.test.py.md new file mode 100644 index 0000000..f1749db --- /dev/null +++ b/Test/AOJ/GRL/GRL_1_A.test.py.md @@ -0,0 +1,39 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_A\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Graph import Dijkstra\n\n\ + \ndef main():\n V, E, r = map(int, input().split())\n g = [[] for _ in range(V)]\n\ + \ INF = 10**18\n for _ in range(E):\n s, t, d = map(int, input().split())\n\ + \ g[s].append((t, d))\n\n dist = Dijkstra.dijkstra(r, g)\n for i\ + \ in range(V):\n print(dist[i]) if dist[i] != INF else print(\"INF\")\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/GRL/GRL_1_A.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/GRL/GRL_1_A.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/GRL/GRL_1_A.test.py +- /verify/Test/AOJ/GRL/GRL_1_A.test.py.html +title: Test/AOJ/GRL/GRL_1_A.test.py +--- diff --git a/Test/AOJ/GRL/GRL_1_B.test.py b/Test/AOJ/GRL/GRL_1_B.test.py deleted file mode 100644 index f18e2d2..0000000 --- a/Test/AOJ/GRL/GRL_1_B.test.py +++ /dev/null @@ -1,42 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_B - -import sys -sys.path.append("../../../") - -from Graph import BellmanFord -from Search import BreadthFirstSearch_graph - -def main() -> None: - V, E, r = map(int, input().split()) - s, t, d = [0] * E, [0] * E, [0] * E - - g = [[] for _ in range(V)] - for i in range(E): - s[i], t[i], d[i] = map(int, input().split()) - g[s[i]].append(t[i]) - - dist = BreadthFirstSearch_graph.bfs(V, g, r) - judge = [False] * V - - for i in range(V): - if dist[i] != float('inf'): - judge[i] = True - - g = [] - for i in range(E): - if judge[s[i]]: - g.append((s[i], t[i], d[i])) - - ans = BellmanFord.bellman_ford(V, g, r) - if ans == -1: - print('NEGATIVE CYCLE') - else: - for i in range(V): - if ans[i] == float('inf'): - print('INF') - else: - print(ans[i]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/GRL/GRL_1_B.test.py.md b/Test/AOJ/GRL/GRL_1_B.test.py.md new file mode 100644 index 0000000..02d085a --- /dev/null +++ b/Test/AOJ/GRL/GRL_1_B.test.py.md @@ -0,0 +1,45 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_B + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_B + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_B\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Graph import BellmanFord\n\ + from Search import BreadthFirstSearch_graph\n\ndef main() -> None:\n V, E,\ + \ r = map(int, input().split())\n s, t, d = [0] * E, [0] * E, [0] * E\n\n \ + \ g = [[] for _ in range(V)]\n for i in range(E):\n s[i], t[i], d[i]\ + \ = map(int, input().split())\n g[s[i]].append(t[i])\n\n dist = BreadthFirstSearch_graph.bfs(V,\ + \ g, r)\n judge = [False] * V\n\n for i in range(V):\n if dist[i]\ + \ != float('inf'):\n judge[i] = True\n \n g = []\n for i in\ + \ range(E):\n if judge[s[i]]:\n g.append((s[i], t[i], d[i]))\n\ + \n ans = BellmanFord.bellman_ford(V, g, r)\n if ans == -1:\n print('NEGATIVE\ + \ CYCLE')\n else:\n for i in range(V):\n if ans[i] == float('inf'):\n\ + \ print('INF')\n else:\n print(ans[i])\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/GRL/GRL_1_B.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/GRL/GRL_1_B.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/GRL/GRL_1_B.test.py +- /verify/Test/AOJ/GRL/GRL_1_B.test.py.html +title: Test/AOJ/GRL/GRL_1_B.test.py +--- diff --git a/Test/AOJ/ITP1/ALDS1_10_C.test.py b/Test/AOJ/ITP1/ALDS1_10_C.test.py deleted file mode 100644 index 7e10a65..0000000 --- a/Test/AOJ/ITP1/ALDS1_10_C.test.py +++ /dev/null @@ -1,15 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_C&lang=ja -# verification-helper: ERROR 1e-4 - -from statistics import pstdev - -def main(): - while True: - n = int(input()) - if n == 0: - exit() - print(pstdev(list(map(int, input().split())))) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ALDS1_10_C.test.py.md b/Test/AOJ/ITP1/ALDS1_10_C.test.py.md new file mode 100644 index 0000000..e1b005c --- /dev/null +++ b/Test/AOJ/ITP1/ALDS1_10_C.test.py.md @@ -0,0 +1,38 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + ERROR: 1e-4 + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_C&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_C&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_C&lang=ja\n\ + # verification-helper: ERROR 1e-4\n\nfrom statistics import pstdev\n\ndef main():\n\ + \ while True:\n n = int(input())\n if n == 0:\n exit()\n\ + \ print(pstdev(list(map(int, input().split()))))\n\n\nif __name__ == \"\ + __main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ITP1/ALDS1_10_C.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ALDS1_10_C.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ALDS1_10_C.test.py +- /verify/Test/AOJ/ITP1/ALDS1_10_C.test.py.html +title: Test/AOJ/ITP1/ALDS1_10_C.test.py +--- diff --git a/Test/AOJ/ITP1/ALDS1_10_D.test.py b/Test/AOJ/ITP1/ALDS1_10_D.test.py deleted file mode 100644 index 50f444c..0000000 --- a/Test/AOJ/ITP1/ALDS1_10_D.test.py +++ /dev/null @@ -1,23 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D&lang=ja -# verification-helper: ERROR 1e-5 - -def main(): - n = int(input()) - x = list(map(int, input().split())) - y = list(map(int, input().split())) - - ans = [0] * 4 - for i in range(n): - ans[0] += abs(x[i] - y[i]) - ans[1] += abs(x[i] - y[i]) ** 2 - ans[2] += abs(x[i] - y[i]) ** 3 - ans[3] = max(ans[3], abs(x[i] - y[i])) - - print(ans[0]) - print(ans[1]**0.5) - print(ans[2]**(1/3)) - print(ans[3]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ALDS1_10_D.test.py.md b/Test/AOJ/ITP1/ALDS1_10_D.test.py.md new file mode 100644 index 0000000..5dc275d --- /dev/null +++ b/Test/AOJ/ITP1/ALDS1_10_D.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + ERROR: 1e-5 + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D&lang=ja\n\ + # verification-helper: ERROR 1e-5\n\ndef main():\n n = int(input())\n x\ + \ = list(map(int, input().split()))\n y = list(map(int, input().split()))\n\ + \n ans = [0] * 4\n for i in range(n):\n ans[0] += abs(x[i] - y[i])\n\ + \ ans[1] += abs(x[i] - y[i]) ** 2\n ans[2] += abs(x[i] - y[i]) **\ + \ 3\n ans[3] = max(ans[3], abs(x[i] - y[i]))\n \n print(ans[0])\n\ + \ print(ans[1]**0.5)\n print(ans[2]**(1/3))\n print(ans[3])\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ITP1/ALDS1_10_D.test.py + requiredBy: [] + timestamp: '2023-06-30 14:54:43+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ALDS1_10_D.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ALDS1_10_D.test.py +- /verify/Test/AOJ/ITP1/ALDS1_10_D.test.py.html +title: Test/AOJ/ITP1/ALDS1_10_D.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_11_A.test.py b/Test/AOJ/ITP1/ITP1_11_A.test.py deleted file mode 100644 index c72c66d..0000000 --- a/Test/AOJ/ITP1/ITP1_11_A.test.py +++ /dev/null @@ -1,39 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_A&lang=ja - -import sys -sys.path.append("../../../") - -from Math import Dice - -def main() -> None: - up, front, right, left, back, down = map(int, input().split()) - d = {} - d[1] = up - d[2] = front - d[3] = right - d[4] = left - d[5] = back - d[6] = down - - # E: 右に回転, N: 奥に回転, S: 手前に回転, W: 左に回転 - # u,d,f,b,l,rをそれぞれ 0,1,2,3,4,5としてstate1,state2に指定 - dice = Dice.Dice(0, 1, 2, 2, 0, 0) - - direction = input() - for i in direction: - if i == "E": - dice.RotateE() - if i == "N": - dice.RotateN() - if i == "S": - dice.RotateS() - if i == "W": - dice.RotateW() - - state = dice.status() - - print(d[state[0]]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_11_A.test.py.md b/Test/AOJ/ITP1/ITP1_11_A.test.py.md new file mode 100644 index 0000000..30ca137 --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_11_A.test.py.md @@ -0,0 +1,49 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Dice.py + title: Math/Dice.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_A&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_A&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_A&lang=ja\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import Dice\n\ndef main()\ + \ -> None:\n up, front, right, left, back, down = map(int, input().split())\n\ + \ d = {}\n d[1] = up\n d[2] = front\n d[3] = right\n d[4] = left\n\ + \ d[5] = back\n d[6] = down\n\n # E: \u53F3\u306B\u56DE\u8EE2, N: \u5965\ + \u306B\u56DE\u8EE2, S: \u624B\u524D\u306B\u56DE\u8EE2, W: \u5DE6\u306B\u56DE\u8EE2\ + \n # u,d,f,b,l,r\u3092\u305D\u308C\u305E\u308C 0,1,2,3,4,5\u3068\u3057\u3066\ + state1,state2\u306B\u6307\u5B9A\n dice = Dice.Dice(0, 1, 2, 2, 0, 0)\n\n \ + \ direction = input()\n for i in direction:\n if i == \"E\":\n \ + \ dice.RotateE()\n if i == \"N\":\n dice.RotateN()\n\ + \ if i == \"S\":\n dice.RotateS()\n if i == \"W\":\n\ + \ dice.RotateW()\n\n state = dice.status()\n\n print(d[state[0]])\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/Dice.py + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_11_A.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_11_A.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_11_A.test.py +- /verify/Test/AOJ/ITP1/ITP1_11_A.test.py.html +title: Test/AOJ/ITP1/ITP1_11_A.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_11_B.test.py b/Test/AOJ/ITP1/ITP1_11_B.test.py deleted file mode 100644 index 68c2b92..0000000 --- a/Test/AOJ/ITP1/ITP1_11_B.test.py +++ /dev/null @@ -1,34 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_B&lang=ja - -import sys -sys.path.append("../../../") - -from Math import Dice - -def main() -> None: - up, front, right, left, back, down = map(int, input().split()) - d = {} - d[1] = up - d[2] = front - d[3] = right - d[4] = left - d[5] = back - d[6] = down - - rev_d = {} - rev_d[up] = 1 - rev_d[front] = 2 - rev_d[right] = 3 - rev_d[left] = 4 - rev_d[back] = 5 - rev_d[down] = 6 - - q = int(input()) - for _ in range(q): - up, front = map(int, input().split()) - dice = Dice.Dice(0, rev_d[up], 2, rev_d[front], 0, 0) - print(d[dice.status()[4]]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_11_B.test.py.md b/Test/AOJ/ITP1/ITP1_11_B.test.py.md new file mode 100644 index 0000000..05597c3 --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_11_B.test.py.md @@ -0,0 +1,46 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Dice.py + title: Math/Dice.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_B&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_B&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_B&lang=ja\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import Dice\n\ndef main()\ + \ -> None:\n up, front, right, left, back, down = map(int, input().split())\n\ + \ d = {}\n d[1] = up\n d[2] = front\n d[3] = right\n d[4] = left\n\ + \ d[5] = back\n d[6] = down\n\n rev_d = {}\n rev_d[up] = 1\n rev_d[front]\ + \ = 2\n rev_d[right] = 3\n rev_d[left] = 4\n rev_d[back] = 5\n rev_d[down]\ + \ = 6\n\n q = int(input())\n for _ in range(q):\n up, front = map(int,\ + \ input().split())\n dice = Dice.Dice(0, rev_d[up], 2, rev_d[front], 0,\ + \ 0)\n print(d[dice.status()[4]])\n\n\nif __name__ == \"__main__\":\n \ + \ main()" + dependsOn: + - Math/Dice.py + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_11_B.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_11_B.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_11_B.test.py +- /verify/Test/AOJ/ITP1/ITP1_11_B.test.py.html +title: Test/AOJ/ITP1/ITP1_11_B.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_11_C.test.py b/Test/AOJ/ITP1/ITP1_11_C.test.py deleted file mode 100644 index 36e0f96..0000000 --- a/Test/AOJ/ITP1/ITP1_11_C.test.py +++ /dev/null @@ -1,62 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_C&lang=ja - -import sys -sys.path.append("../../../") - -from Math import Dice -from random import randint - -def main() -> None: - - up_1, front_1, right_1, left_1, back_1, down_1 = map(int, input().split()) - up_2, front_2, right_2, left_2, back_2, down_2 = map(int, input().split()) - - # サイコロの目が 1~6 ではない場合に置き換える - replace_dice1, replace_dice2 = {}, {} - replace_dice1[f"{up_1}-1"], replace_dice2[f"{up_2}-1"] = 1, 1 - replace_dice1[f"{front_1}-2"], replace_dice2[f"{front_2}-2"] = 2, 2 - replace_dice1[f"{right_1}-3"], replace_dice2[f"{right_2}-3"] = 3, 3 - replace_dice1[f"{left_1}-4"], replace_dice2[f"{left_2}-4"] = 4, 4 - replace_dice1[f"{back_1}-5"], replace_dice2[f"{back_2}-5"] = 5, 5 - replace_dice1[f"{down_1}-6"], replace_dice2[f"{down_2}-6"] = 6, 6 - - # 置き換えた場合に復元する用の辞書 - restoration_dice1, restoration_dice2 = {}, {} - restoration_dice1[1], restoration_dice2[1] = up_1, up_2 - restoration_dice1[2], restoration_dice2[2] = front_1, front_2 - restoration_dice1[3], restoration_dice2[3] = right_1, right_2 - restoration_dice1[4], restoration_dice2[4] = left_1, left_2 - restoration_dice1[5], restoration_dice2[5] = back_1, back_2 - restoration_dice1[6], restoration_dice2[6] = down_1, down_2 - - # u,d,f,b,l,r をそれぞれ 0,1,2,3,4,5 として state1,state2 に指定 - # value1,value2 はそれぞれ state1, state2 に対応する面の目 - - dice1 = Dice.Dice(0, replace_dice1[f"{up_1}-1"], 2, replace_dice1[f"{front_1}-2"], 0, 0) - dice2 = Dice.Dice(0, replace_dice2[f"{up_2}-1"], 2, replace_dice2[f"{front_2}-2"], 0, 0) - - check = False - for _ in range(1000): - p = randint(0, 3) - if p == 0: - dice1.RotateN() - if p == 1: - dice1.RotateS() - if p == 2: - dice1.RotateW() - if p == 3: - dice1.RotateE() - - is_ok = True - for i in range(6): - if restoration_dice1[dice1.status()[i]] != restoration_dice2[dice2.status()[i]]: - is_ok = False - - if is_ok: - check = True - - print("Yes") if check else print("No") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_11_C.test.py.md b/Test/AOJ/ITP1/ITP1_11_C.test.py.md new file mode 100644 index 0000000..9bff96a --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_11_C.test.py.md @@ -0,0 +1,64 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_C&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_C&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_C&lang=ja\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import Dice\nfrom random\ + \ import randint\n\ndef main() -> None:\n\n up_1, front_1, right_1, left_1,\ + \ back_1, down_1 = map(int, input().split())\n up_2, front_2, right_2, left_2,\ + \ back_2, down_2 = map(int, input().split())\n\n # \u30B5\u30A4\u30B3\u30ED\ + \u306E\u76EE\u304C 1~6 \u3067\u306F\u306A\u3044\u5834\u5408\u306B\u7F6E\u304D\u63DB\ + \u3048\u308B\n replace_dice1, replace_dice2 = {}, {}\n replace_dice1[f\"\ + {up_1}-1\"], replace_dice2[f\"{up_2}-1\"] = 1, 1\n replace_dice1[f\"{front_1}-2\"\ + ], replace_dice2[f\"{front_2}-2\"] = 2, 2\n replace_dice1[f\"{right_1}-3\"\ + ], replace_dice2[f\"{right_2}-3\"] = 3, 3\n replace_dice1[f\"{left_1}-4\"],\ + \ replace_dice2[f\"{left_2}-4\"] = 4, 4\n replace_dice1[f\"{back_1}-5\"], replace_dice2[f\"\ + {back_2}-5\"] = 5, 5\n replace_dice1[f\"{down_1}-6\"], replace_dice2[f\"{down_2}-6\"\ + ] = 6, 6\n\n # \u7F6E\u304D\u63DB\u3048\u305F\u5834\u5408\u306B\u5FA9\u5143\ + \u3059\u308B\u7528\u306E\u8F9E\u66F8\n restoration_dice1, restoration_dice2\ + \ = {}, {}\n restoration_dice1[1], restoration_dice2[1] = up_1, up_2\n restoration_dice1[2],\ + \ restoration_dice2[2] = front_1, front_2\n restoration_dice1[3], restoration_dice2[3]\ + \ = right_1, right_2\n restoration_dice1[4], restoration_dice2[4] = left_1,\ + \ left_2\n restoration_dice1[5], restoration_dice2[5] = back_1, back_2\n \ + \ restoration_dice1[6], restoration_dice2[6] = down_1, down_2\n\n # u,d,f,b,l,r\ + \ \u3092\u305D\u308C\u305E\u308C 0,1,2,3,4,5 \u3068\u3057\u3066 state1,state2\ + \ \u306B\u6307\u5B9A\n # value1,value2 \u306F\u305D\u308C\u305E\u308C state1,\ + \ state2 \u306B\u5BFE\u5FDC\u3059\u308B\u9762\u306E\u76EE\n\n dice1 = Dice.Dice(0,\ + \ replace_dice1[f\"{up_1}-1\"], 2, replace_dice1[f\"{front_1}-2\"], 0, 0)\n \ + \ dice2 = Dice.Dice(0, replace_dice2[f\"{up_2}-1\"], 2, replace_dice2[f\"{front_2}-2\"\ + ], 0, 0)\n\n check = False\n for _ in range(1000):\n p = randint(0,\ + \ 3)\n if p == 0:\n dice1.RotateN()\n if p == 1:\n \ + \ dice1.RotateS()\n if p == 2:\n dice1.RotateW()\n\ + \ if p == 3:\n dice1.RotateE()\n\n is_ok = True\n \ + \ for i in range(6):\n if restoration_dice1[dice1.status()[i]]\ + \ != restoration_dice2[dice2.status()[i]]:\n is_ok = False\n \ + \ \n if is_ok:\n check = True\n\n print(\"Yes\") if\ + \ check else print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_11_C.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_11_C.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_11_C.test.py +- /verify/Test/AOJ/ITP1/ITP1_11_C.test.py.html +title: Test/AOJ/ITP1/ITP1_11_C.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_11_D.test.py b/Test/AOJ/ITP1/ITP1_11_D.test.py deleted file mode 100644 index 2846285..0000000 --- a/Test/AOJ/ITP1/ITP1_11_D.test.py +++ /dev/null @@ -1,67 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_D&lang=ja - -import sys -sys.path.append("../../../") - -from Math import Dice -from random import randint - - -def main() -> None: - - n = int(input()) - a = [list(map(int, input().split())) for _ in range(n)] - - ans = True - for i in range(n - 1): - for j in range(i + 1, n): - - up_1, front_1, right_1, left_1, back_1, down_1 = a[i] - up_2, front_2, right_2, left_2, back_2, down_2 = a[j] - - # サイコロの目が 1~6 ではない場合に置き換える - replace_dice1, replace_dice2 = {}, {} - replace_dice1[f"{up_1}-1"], replace_dice2[f"{up_2}-1"] = 1, 1 - replace_dice1[f"{front_1}-2"], replace_dice2[f"{front_2}-2"] = 2, 2 - replace_dice1[f"{right_1}-3"], replace_dice2[f"{right_2}-3"] = 3, 3 - replace_dice1[f"{left_1}-4"], replace_dice2[f"{left_2}-4"] = 4, 4 - replace_dice1[f"{back_1}-5"], replace_dice2[f"{back_2}-5"] = 5, 5 - replace_dice1[f"{down_1}-6"], replace_dice2[f"{down_2}-6"] = 6, 6 - - # 置き換えた場合に復元する用の辞書 - restoration_dice1, restoration_dice2 = {}, {} - restoration_dice1[1], restoration_dice2[1] = up_1, up_2 - restoration_dice1[2], restoration_dice2[2] = front_1, front_2 - restoration_dice1[3], restoration_dice2[3] = right_1, right_2 - restoration_dice1[4], restoration_dice2[4] = left_1, left_2 - restoration_dice1[5], restoration_dice2[5] = back_1, back_2 - restoration_dice1[6], restoration_dice2[6] = down_1, down_2 - - dice1 = Dice.Dice(0, replace_dice1[f"{up_1}-1"], 2, replace_dice1[f"{front_1}-2"], 0, 0) - dice2 = Dice.Dice(0, replace_dice2[f"{up_2}-1"], 2, replace_dice2[f"{front_2}-2"], 0, 0) - - for _ in range(1000): - p = randint(0, 3) - if p == 0: - dice1.RotateN() - if p == 1: - dice1.RotateS() - if p == 2: - dice1.RotateW() - if p == 3: - dice1.RotateE() - - check = 0 - for k in range(6): - if restoration_dice1[dice1.status()[k]] == restoration_dice2[dice2.status()[k]]: - check += 1 - - if check == 6: - ans = False - break - - print("Yes") if ans else print("No") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_11_D.test.py.md b/Test/AOJ/ITP1/ITP1_11_D.test.py.md new file mode 100644 index 0000000..69f040f --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_11_D.test.py.md @@ -0,0 +1,66 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_D&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_D&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_11_D&lang=ja\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import Dice\nfrom random\ + \ import randint\n\n\ndef main() -> None:\n\n n = int(input())\n a = [list(map(int,\ + \ input().split())) for _ in range(n)]\n\n ans = True\n for i in range(n\ + \ - 1):\n for j in range(i + 1, n):\n\n up_1, front_1, right_1,\ + \ left_1, back_1, down_1 = a[i]\n up_2, front_2, right_2, left_2, back_2,\ + \ down_2 = a[j]\n\n # \u30B5\u30A4\u30B3\u30ED\u306E\u76EE\u304C 1~6\ + \ \u3067\u306F\u306A\u3044\u5834\u5408\u306B\u7F6E\u304D\u63DB\u3048\u308B\n \ + \ replace_dice1, replace_dice2 = {}, {}\n replace_dice1[f\"\ + {up_1}-1\"], replace_dice2[f\"{up_2}-1\"] = 1, 1\n replace_dice1[f\"\ + {front_1}-2\"], replace_dice2[f\"{front_2}-2\"] = 2, 2\n replace_dice1[f\"\ + {right_1}-3\"], replace_dice2[f\"{right_2}-3\"] = 3, 3\n replace_dice1[f\"\ + {left_1}-4\"], replace_dice2[f\"{left_2}-4\"] = 4, 4\n replace_dice1[f\"\ + {back_1}-5\"], replace_dice2[f\"{back_2}-5\"] = 5, 5\n replace_dice1[f\"\ + {down_1}-6\"], replace_dice2[f\"{down_2}-6\"] = 6, 6\n\n # \u7F6E\u304D\ + \u63DB\u3048\u305F\u5834\u5408\u306B\u5FA9\u5143\u3059\u308B\u7528\u306E\u8F9E\ + \u66F8\n restoration_dice1, restoration_dice2 = {}, {}\n \ + \ restoration_dice1[1], restoration_dice2[1] = up_1, up_2\n restoration_dice1[2],\ + \ restoration_dice2[2] = front_1, front_2\n restoration_dice1[3], restoration_dice2[3]\ + \ = right_1, right_2\n restoration_dice1[4], restoration_dice2[4] =\ + \ left_1, left_2\n restoration_dice1[5], restoration_dice2[5] = back_1,\ + \ back_2\n restoration_dice1[6], restoration_dice2[6] = down_1, down_2\n\ + \n dice1 = Dice.Dice(0, replace_dice1[f\"{up_1}-1\"], 2, replace_dice1[f\"\ + {front_1}-2\"], 0, 0)\n dice2 = Dice.Dice(0, replace_dice2[f\"{up_2}-1\"\ + ], 2, replace_dice2[f\"{front_2}-2\"], 0, 0)\n\n for _ in range(1000):\n\ + \ p = randint(0, 3)\n if p == 0:\n \ + \ dice1.RotateN()\n if p == 1:\n dice1.RotateS()\n\ + \ if p == 2:\n dice1.RotateW()\n \ + \ if p == 3:\n dice1.RotateE()\n \n \ + \ check = 0\n for k in range(6):\n \ + \ if restoration_dice1[dice1.status()[k]] == restoration_dice2[dice2.status()[k]]:\n\ + \ check += 1\n\n if check == 6:\n \ + \ ans = False\n break\n\n print(\"Yes\") if\ + \ ans else print(\"No\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_11_D.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_11_D.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_11_D.test.py +- /verify/Test/AOJ/ITP1/ITP1_11_D.test.py.html +title: Test/AOJ/ITP1/ITP1_11_D.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_2_A.test.py b/Test/AOJ/ITP1/ITP1_2_A.test.py deleted file mode 100644 index 90338cb..0000000 --- a/Test/AOJ/ITP1/ITP1_2_A.test.py +++ /dev/null @@ -1,15 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_A&lang=ja - - -def main() -> None: - a, b = map(int, input().split()) - if a < b: - print("a < b") - elif a > b: - print("a > b") - else: - print("a == b") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_2_A.test.py.md b/Test/AOJ/ITP1/ITP1_2_A.test.py.md new file mode 100644 index 0000000..d570c1b --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_2_A.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_A&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_A&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_2_A&lang=ja\n\ + \n\ndef main() -> None:\n a, b = map(int, input().split())\n if a < b:\n\ + \ print(\"a < b\")\n elif a > b:\n print(\"a > b\")\n else:\n\ + \ print(\"a == b\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_2_A.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_2_A.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_2_A.test.py +- /verify/Test/AOJ/ITP1/ITP1_2_A.test.py.html +title: Test/AOJ/ITP1/ITP1_2_A.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_3_D.test.py b/Test/AOJ/ITP1/ITP1_3_D.test.py deleted file mode 100644 index 2e39347..0000000 --- a/Test/AOJ/ITP1/ITP1_3_D.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_D - -import sys -sys.path.append("../../../") - -from Math import Divisor - -def main() -> None: - a, b, c = map(int, input().split()) - - ans = 0 - for i in Divisor.divisors(c): - if a <= i <= b: - ans += 1 - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_3_D.test.py.md b/Test/AOJ/ITP1/ITP1_3_D.test.py.md new file mode 100644 index 0000000..f22f0f1 --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_3_D.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Divisor.py + title: Math/Divisor.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_D + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_D + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_3_D\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import Divisor\n\ndef\ + \ main() -> None:\n a, b, c = map(int, input().split())\n\n ans = 0\n \ + \ for i in Divisor.divisors(c):\n if a <= i <= b:\n ans +=\ + \ 1\n \n print(ans)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/Divisor.py + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_3_D.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_3_D.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_3_D.test.py +- /verify/Test/AOJ/ITP1/ITP1_3_D.test.py.html +title: Test/AOJ/ITP1/ITP1_3_D.test.py +--- diff --git a/Test/AOJ/ITP1/ITP1_8_B.test.py b/Test/AOJ/ITP1/ITP1_8_B.test.py deleted file mode 100644 index 09eae50..0000000 --- a/Test/AOJ/ITP1/ITP1_8_B.test.py +++ /dev/null @@ -1,18 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_B&lang=ja - -import sys -sys.path.append("../../../") - -from Math import DigitSum_int - -def main() -> None: - while True: - n = int(input()) - if n == 0: - exit() - - print(DigitSum_int.DigitSum(n)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/ITP1/ITP1_8_B.test.py.md b/Test/AOJ/ITP1/ITP1_8_B.test.py.md new file mode 100644 index 0000000..689735e --- /dev/null +++ b/Test/AOJ/ITP1/ITP1_8_B.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/DigitSum_int.py + title: Math/DigitSum_int.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_B&lang=ja + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_B&lang=ja + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_8_B&lang=ja\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import DigitSum_int\n\ + \ndef main() -> None:\n while True:\n n = int(input())\n if n\ + \ == 0:\n exit()\n \n print(DigitSum_int.DigitSum(n))\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/DigitSum_int.py + isVerificationFile: true + path: Test/AOJ/ITP1/ITP1_8_B.test.py + requiredBy: [] + timestamp: '2023-06-30 10:01:09+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/ITP1/ITP1_8_B.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/ITP1/ITP1_8_B.test.py +- /verify/Test/AOJ/ITP1/ITP1_8_B.test.py.html +title: Test/AOJ/ITP1/ITP1_8_B.test.py +--- diff --git a/Test/AOJ/Volume0/0000.test.py b/Test/AOJ/Volume0/0000.test.py deleted file mode 100644 index 2c73d4d..0000000 --- a/Test/AOJ/Volume0/0000.test.py +++ /dev/null @@ -1,10 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0000 - -def main(): - for i in range(1, 10): - for j in range(1, 10): - print(f"{i}x{j}={i * j}") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume0/0000.test.py.md b/Test/AOJ/Volume0/0000.test.py.md new file mode 100644 index 0000000..0bb39d8 --- /dev/null +++ b/Test/AOJ/Volume0/0000.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0000 + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0000 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0000\n\ + \ndef main():\n for i in range(1, 10):\n for j in range(1, 10):\n \ + \ print(f\"{i}x{j}={i * j}\")\n\n\nif __name__ == \"__main__\":\n \ + \ main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume0/0000.test.py + requiredBy: [] + timestamp: '2022-08-11 00:02:49+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume0/0000.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume0/0000.test.py +- /verify/Test/AOJ/Volume0/0000.test.py.html +title: Test/AOJ/Volume0/0000.test.py +--- diff --git a/Test/AOJ/Volume0/0001.test.py b/Test/AOJ/Volume0/0001.test.py deleted file mode 100644 index 08c3188..0000000 --- a/Test/AOJ/Volume0/0001.test.py +++ /dev/null @@ -1,8 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001 - -def main(): - print(*sorted([int(input()) for _ in range(10)], reverse=True)[:3], sep='\n') - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume0/0001.test.py.md b/Test/AOJ/Volume0/0001.test.py.md new file mode 100644 index 0000000..d949b40 --- /dev/null +++ b/Test/AOJ/Volume0/0001.test.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001 + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0001\n\ + \ndef main():\n print(*sorted([int(input()) for _ in range(10)], reverse=True)[:3],\ + \ sep='\\n')\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume0/0001.test.py + requiredBy: [] + timestamp: '2023-07-01 01:49:57+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume0/0001.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume0/0001.test.py +- /verify/Test/AOJ/Volume0/0001.test.py.html +title: Test/AOJ/Volume0/0001.test.py +--- diff --git a/Test/AOJ/Volume0/0002.test.py b/Test/AOJ/Volume0/0002.test.py deleted file mode 100644 index c17131d..0000000 --- a/Test/AOJ/Volume0/0002.test.py +++ /dev/null @@ -1,14 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0002 - -def main(): - while True: - try: - a, b = map(int, input().split()) - except: - break - - print(len(str(a + b))) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume0/0002.test.py.md b/Test/AOJ/Volume0/0002.test.py.md new file mode 100644 index 0000000..efa4378 --- /dev/null +++ b/Test/AOJ/Volume0/0002.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0002 + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0002 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0002\n\ + \ndef main():\n while True:\n try:\n a, b = map(int, input().split())\n\ + \ except:\n break\n \n print(len(str(a + b)))\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume0/0002.test.py + requiredBy: [] + timestamp: '2023-07-01 01:49:57+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/AOJ/Volume0/0002.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume0/0002.test.py +- /verify/Test/AOJ/Volume0/0002.test.py.html +title: Test/AOJ/Volume0/0002.test.py +--- diff --git a/Test/AOJ/Volume0/0003.test.py b/Test/AOJ/Volume0/0003.test.py deleted file mode 100644 index 2164b72..0000000 --- a/Test/AOJ/Volume0/0003.test.py +++ /dev/null @@ -1,11 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003 - -def main(): - N = int(input()) - for _ in range(N): - a, b, c = sorted(list(map(int, input().split()))) - print("YES") if a ** 2 + b ** 2 == c ** 2 else print("NO") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume0/0003.test.py.md b/Test/AOJ/Volume0/0003.test.py.md new file mode 100644 index 0000000..568f098 --- /dev/null +++ b/Test/AOJ/Volume0/0003.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003 + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0003\n\ + \ndef main():\n N = int(input())\n for _ in range(N):\n a, b, c =\ + \ sorted(list(map(int, input().split())))\n print(\"YES\") if a ** 2 +\ + \ b ** 2 == c ** 2 else print(\"NO\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume0/0003.test.py + requiredBy: [] + timestamp: '2023-07-01 01:49:57+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/AOJ/Volume0/0003.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume0/0003.test.py +- /verify/Test/AOJ/Volume0/0003.test.py.html +title: Test/AOJ/Volume0/0003.test.py +--- diff --git a/Test/AOJ/Volume0/0004.test.py b/Test/AOJ/Volume0/0004.test.py deleted file mode 100644 index b617060..0000000 --- a/Test/AOJ/Volume0/0004.test.py +++ /dev/null @@ -1,22 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004 - -def main(): - while True: - try: - a, b, c, d, e, f = map(int, input().split()) - except: - break - - if a * e - b * d == 0: - print("0.000 0.000") - else: - p, q = e * c - b * f, -d * c + a * f - if p != 0: - p /= (a * e - b * d) - if q != 0: - q /= (a * e - b * d) - print("{:.3f}".format(p), "{:.3f}".format(q)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume0/0004.test.py.md b/Test/AOJ/Volume0/0004.test.py.md new file mode 100644 index 0000000..a8ca7d5 --- /dev/null +++ b/Test/AOJ/Volume0/0004.test.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004 + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0004\n\ + \ndef main():\n while True:\n try:\n a, b, c, d, e, f = map(int,\ + \ input().split())\n except:\n break\n \n \ + \ if a * e - b * d == 0:\n print(\"0.000 0.000\")\n else:\n\ + \ p, q = e * c - b * f, -d * c + a * f\n if p != 0:\n \ + \ p /= (a * e - b * d)\n if q != 0:\n q\ + \ /= (a * e - b * d)\n print(\"{:.3f}\".format(p), \"{:.3f}\".format(q))\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume0/0004.test.py + requiredBy: [] + timestamp: '2023-07-01 01:49:57+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/AOJ/Volume0/0004.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume0/0004.test.py +- /verify/Test/AOJ/Volume0/0004.test.py.html +title: Test/AOJ/Volume0/0004.test.py +--- diff --git a/Test/AOJ/Volume10/1000.test.py b/Test/AOJ/Volume10/1000.test.py deleted file mode 100644 index 912a9c0..0000000 --- a/Test/AOJ/Volume10/1000.test.py +++ /dev/null @@ -1,13 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1000&lang=en - -def main(): - while True: - try: - a, b = map(int, input().split()) - print(a + b) - except: - break - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume10/1000.test.py.md b/Test/AOJ/Volume10/1000.test.py.md new file mode 100644 index 0000000..5f6f723 --- /dev/null +++ b/Test/AOJ/Volume10/1000.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1000&lang=en + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1000&lang=en + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1000&lang=en\n\ + \ndef main():\n while True:\n try:\n a, b = map(int, input().split())\n\ + \ print(a + b)\n except:\n break\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume10/1000.test.py + requiredBy: [] + timestamp: '2023-06-29 01:19:46+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume10/1000.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume10/1000.test.py +- /verify/Test/AOJ/Volume10/1000.test.py.html +title: Test/AOJ/Volume10/1000.test.py +--- diff --git a/Test/AOJ/Volume11/1147.test.py b/Test/AOJ/Volume11/1147.test.py deleted file mode 100644 index ee68283..0000000 --- a/Test/AOJ/Volume11/1147.test.py +++ /dev/null @@ -1,14 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1147&lang=jp - -def main() -> None: - while True: - n = int(input()) - if n == 0: - exit() - - a = [int(input()) for _ in range(n)] - print((sum(a) - (min(a) + max(a))) // (n - 2)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume11/1147.test.py.md b/Test/AOJ/Volume11/1147.test.py.md new file mode 100644 index 0000000..b359c84 --- /dev/null +++ b/Test/AOJ/Volume11/1147.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1147&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1147&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1147&lang=jp\n\ + \ndef main() -> None:\n while True:\n n = int(input())\n if n\ + \ == 0:\n exit()\n \n a = [int(input()) for _ in range(n)]\n\ + \ print((sum(a) - (min(a) + max(a))) // (n - 2))\n\n\nif __name__ == \"\ + __main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume11/1147.test.py + requiredBy: [] + timestamp: '2023-06-29 01:08:34+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume11/1147.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume11/1147.test.py +- /verify/Test/AOJ/Volume11/1147.test.py.html +title: Test/AOJ/Volume11/1147.test.py +--- diff --git a/Test/AOJ/Volume11/1153.test.py b/Test/AOJ/Volume11/1153.test.py deleted file mode 100644 index 458a25f..0000000 --- a/Test/AOJ/Volume11/1153.test.py +++ /dev/null @@ -1,26 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1153&lang=jp - -def main() -> None: - while True: - n, m = map(int, input().split()) - if (n, m) == (0, 0): - exit() - - s = [int(input()) for _ in range(n)] - t = [int(input()) for _ in range(m)] - - sum1, sum2 = sum(s), sum(t) - num = 10**18 - ans = [0, 0] - for i in range(n): - for j in range(m): - if sum1 - s[i] + t[j] == sum2 - t[j] + s[i]: - if s[i] + t[j] < num: - ans = [s[i], t[j]] - num = s[i] + t[j] - - print(*ans) if num != 10**18 else print(-1) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume11/1153.test.py.md b/Test/AOJ/Volume11/1153.test.py.md new file mode 100644 index 0000000..34d93c3 --- /dev/null +++ b/Test/AOJ/Volume11/1153.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1153&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1153&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1153&lang=jp\n\ + \ndef main() -> None:\n while True:\n n, m = map(int, input().split())\n\ + \ if (n, m) == (0, 0):\n exit()\n \n s = [int(input())\ + \ for _ in range(n)]\n t = [int(input()) for _ in range(m)]\n\n \ + \ sum1, sum2 = sum(s), sum(t)\n num = 10**18\n ans = [0, 0]\n \ + \ for i in range(n):\n for j in range(m):\n if\ + \ sum1 - s[i] + t[j] == sum2 - t[j] + s[i]:\n if s[i] + t[j]\ + \ < num:\n ans = [s[i], t[j]]\n \ + \ num = s[i] + t[j]\n \n print(*ans) if num != 10**18 else print(-1)\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume11/1153.test.py + requiredBy: [] + timestamp: '2023-06-29 01:08:34+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume11/1153.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume11/1153.test.py +- /verify/Test/AOJ/Volume11/1153.test.py.html +title: Test/AOJ/Volume11/1153.test.py +--- diff --git a/Test/AOJ/Volume11/1172.test.py b/Test/AOJ/Volume11/1172.test.py deleted file mode 100644 index f547f58..0000000 --- a/Test/AOJ/Volume11/1172.test.py +++ /dev/null @@ -1,26 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1172&lang=jp - -import sys -sys.path.append("../../../") - -from Math import SieveOfEratosthenes -from bisect import bisect_left - -def main() -> None: - - primes_list = SieveOfEratosthenes.primes(123456*2 + 100) - - while True: - n = int(input()) - if n == 0: - exit() - - if n == 1: - print(1) - else: - p, q = bisect_left(primes_list, n + 1), bisect_left(primes_list, 2 * n) - print(q - p) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume11/1172.test.py.md b/Test/AOJ/Volume11/1172.test.py.md new file mode 100644 index 0000000..f15363a --- /dev/null +++ b/Test/AOJ/Volume11/1172.test.py.md @@ -0,0 +1,43 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/SieveOfEratosthenes.py + title: Math/SieveOfEratosthenes.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1172&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1172&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1172&lang=jp\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import SieveOfEratosthenes\n\ + from bisect import bisect_left\n\ndef main() -> None:\n\n primes_list = SieveOfEratosthenes.primes(123456*2\ + \ + 100)\n\n while True:\n n = int(input())\n if n == 0:\n \ + \ exit()\n \n if n == 1:\n print(1)\n \ + \ else:\n p, q = bisect_left(primes_list, n + 1), bisect_left(primes_list,\ + \ 2 * n)\n print(q - p)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/SieveOfEratosthenes.py + isVerificationFile: true + path: Test/AOJ/Volume11/1172.test.py + requiredBy: [] + timestamp: '2023-06-29 01:19:46+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume11/1172.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume11/1172.test.py +- /verify/Test/AOJ/Volume11/1172.test.py.html +title: Test/AOJ/Volume11/1172.test.py +--- diff --git a/Test/AOJ/Volume16/1608.test.py b/Test/AOJ/Volume16/1608.test.py deleted file mode 100644 index 540cba7..0000000 --- a/Test/AOJ/Volume16/1608.test.py +++ /dev/null @@ -1,19 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1608&lang=jp - -def main(): - while True: - n = int(input()) - if n == 0: - exit() - a = list(map(int, input().split())) - a.sort() - - ans = 10**18 - for i in range(n - 1): - ans = min(ans, a[i + 1] - a[i]) - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume16/1608.test.py.md b/Test/AOJ/Volume16/1608.test.py.md new file mode 100644 index 0000000..5547af0 --- /dev/null +++ b/Test/AOJ/Volume16/1608.test.py.md @@ -0,0 +1,38 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1608&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1608&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1608&lang=jp\n\ + \ndef main():\n while True:\n n = int(input())\n if n == 0:\n\ + \ exit()\n a = list(map(int, input().split()))\n a.sort()\n\ + \n ans = 10**18\n for i in range(n - 1):\n ans = min(ans,\ + \ a[i + 1] - a[i])\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n \ + \ main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume16/1608.test.py + requiredBy: [] + timestamp: '2023-06-29 01:08:34+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume16/1608.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume16/1608.test.py +- /verify/Test/AOJ/Volume16/1608.test.py.html +title: Test/AOJ/Volume16/1608.test.py +--- diff --git a/Test/AOJ/Volume16/1640.test.py b/Test/AOJ/Volume16/1640.test.py deleted file mode 100644 index ef1deb9..0000000 --- a/Test/AOJ/Volume16/1640.test.py +++ /dev/null @@ -1,19 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1640&lang=jp - -def main(): - while True: - n = int(input()) - if n == 0: - exit() - d = list(map(int, input().split())) - - ans = 0 - for i in range(n - 3): - if d[i : i + 4] == [2, 0, 2, 0]: - ans += 1 - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume16/1640.test.py.md b/Test/AOJ/Volume16/1640.test.py.md new file mode 100644 index 0000000..d8ece95 --- /dev/null +++ b/Test/AOJ/Volume16/1640.test.py.md @@ -0,0 +1,38 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1640&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1640&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1640&lang=jp\n\ + \ndef main():\n while True:\n n = int(input())\n if n == 0:\n\ + \ exit()\n d = list(map(int, input().split()))\n\n ans\ + \ = 0\n for i in range(n - 3):\n if d[i : i + 4] == [2, 0, 2,\ + \ 0]:\n ans += 1\n \n print(ans)\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume16/1640.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume16/1640.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume16/1640.test.py +- /verify/Test/AOJ/Volume16/1640.test.py.html +title: Test/AOJ/Volume16/1640.test.py +--- diff --git a/Test/AOJ/Volume21/2197.test.py b/Test/AOJ/Volume21/2197.test.py deleted file mode 100644 index 69113c8..0000000 --- a/Test/AOJ/Volume21/2197.test.py +++ /dev/null @@ -1,24 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2197&lang=jp - -def main() -> None: - while True: - n = int(input()) - if n == 0: - exit() - - ans = 0 - for start in range(1, n + 1): - num = start - i = start + 1 - while num < n: - num += i - if num == n: - ans += 1 - break - i += 1 - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume21/2197.test.py.md b/Test/AOJ/Volume21/2197.test.py.md new file mode 100644 index 0000000..01404f4 --- /dev/null +++ b/Test/AOJ/Volume21/2197.test.py.md @@ -0,0 +1,39 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2197&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2197&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2197&lang=jp\n\ + \ndef main() -> None:\n while True:\n n = int(input())\n if n\ + \ == 0:\n exit()\n \n ans = 0\n for start in range(1,\ + \ n + 1):\n num = start\n i = start + 1\n while\ + \ num < n:\n num += i\n if num == n:\n \ + \ ans += 1\n break\n i += 1\n \ + \ \n print(ans)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume21/2197.test.py + requiredBy: [] + timestamp: '2023-06-29 01:37:18+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume21/2197.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume21/2197.test.py +- /verify/Test/AOJ/Volume21/2197.test.py.html +title: Test/AOJ/Volume21/2197.test.py +--- diff --git a/Test/AOJ/Volume29/2944.test.py b/Test/AOJ/Volume29/2944.test.py deleted file mode 100644 index 1e4ce72..0000000 --- a/Test/AOJ/Volume29/2944.test.py +++ /dev/null @@ -1,18 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2944&lang=jp - -def main() -> None: - while True: - n, m = map(int, input().split()) - if (n, m) == (0, 0): - exit() - a = list(map(int, input().split())) - - ans = 0 - for i in range(n): - ans += min(m // n, a[i]) - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume29/2944.test.py.md b/Test/AOJ/Volume29/2944.test.py.md new file mode 100644 index 0000000..d69f6ca --- /dev/null +++ b/Test/AOJ/Volume29/2944.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2944&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2944&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2944&lang=jp\n\ + \ndef main() -> None:\n while True:\n n, m = map(int, input().split())\n\ + \ if (n, m) == (0, 0):\n exit()\n a = list(map(int, input().split()))\n\ + \n ans = 0\n for i in range(n):\n ans += min(m // n,\ + \ a[i])\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume29/2944.test.py + requiredBy: [] + timestamp: '2023-06-29 15:39:20+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume29/2944.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume29/2944.test.py +- /verify/Test/AOJ/Volume29/2944.test.py.html +title: Test/AOJ/Volume29/2944.test.py +--- diff --git a/Test/AOJ/Volume32/3202.test.py b/Test/AOJ/Volume32/3202.test.py deleted file mode 100644 index b2b1de7..0000000 --- a/Test/AOJ/Volume32/3202.test.py +++ /dev/null @@ -1,41 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=3202&lang=jp - -from collections import deque - -def main() -> None: - while True: - w, h, n, d, b = map(int, input().split()) - if (w, h, n, d, b) == (0, 0, 0, 0, 0): - exit() - - grid = [[0] * w for _ in range(h)] - - x, y = [0] * n, [0] * n - for i in range(n): - x[i], y[i] = map(lambda x: int(x) - 1, input().split()) - grid[y[i]][x[i]] = -1 - - ans = 1 - q = deque() - q.append((y[b - 1], x[b - 1])) - grid[y[b - 1]][x[b - 1]] = 1 - while q: - vy, vx = q.popleft() - for dy, dx in ((0, 1), (0, -1), (1, 0), (-1, 0)): - for k in range(1, d + 1): - ny = vy + dy * k - nx = vx + dx * k - if not (0 <= ny < h and 0 <= nx < w): - continue - if grid[ny][nx] == -1: - ans += 1 - grid[ny][nx] = 1 - q.append((ny, nx)) - if grid[ny][nx] == 0: - grid[ny][nx] = 1 - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume32/3202.test.py.md b/Test/AOJ/Volume32/3202.test.py.md new file mode 100644 index 0000000..18b4b98 --- /dev/null +++ b/Test/AOJ/Volume32/3202.test.py.md @@ -0,0 +1,49 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=3202&lang=jp + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=3202&lang=jp + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=3202&lang=jp\n\ + \nfrom collections import deque\n\ndef main() -> None:\n while True:\n \ + \ w, h, n, d, b = map(int, input().split())\n if (w, h, n, d, b) ==\ + \ (0, 0, 0, 0, 0):\n exit()\n \n grid = [[0] * w for\ + \ _ in range(h)]\n\n x, y = [0] * n, [0] * n\n for i in range(n):\n\ + \ x[i], y[i] = map(lambda x: int(x) - 1, input().split())\n \ + \ grid[y[i]][x[i]] = -1\n \n ans = 1\n q = deque()\n\ + \ q.append((y[b - 1], x[b - 1]))\n grid[y[b - 1]][x[b - 1]] = 1\n\ + \ while q:\n vy, vx = q.popleft()\n for dy, dx in\ + \ ((0, 1), (0, -1), (1, 0), (-1, 0)):\n for k in range(1, d + 1):\n\ + \ ny = vy + dy * k\n nx = vx + dx * k\n\ + \ if not (0 <= ny < h and 0 <= nx < w):\n \ + \ continue\n if grid[ny][nx] == -1:\n \ + \ ans += 1\n grid[ny][nx] = 1\n \ + \ q.append((ny, nx))\n if grid[ny][nx] == 0:\n \ + \ grid[ny][nx] = 1\n \n print(ans)\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/AOJ/Volume32/3202.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume32/3202.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume32/3202.test.py +- /verify/Test/AOJ/Volume32/3202.test.py.html +title: Test/AOJ/Volume32/3202.test.py +--- diff --git a/Test/AOJ/Volume5/0516.test.py b/Test/AOJ/Volume5/0516.test.py deleted file mode 100644 index 58db6cd..0000000 --- a/Test/AOJ/Volume5/0516.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0516 - -import sys -sys.path.append("../../../") - -from Math import MaxCumulativeSum - -def main(): - while True: - n, k = map(int, input().split()) - if (n, k) == (0, 0): - exit() - a = [int(input()) for _ in range(n)] - ans = MaxCumulativeSum.MaxCumulativeSum(a, k) - - print(max(ans)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/AOJ/Volume5/0516.test.py.md b/Test/AOJ/Volume5/0516.test.py.md new file mode 100644 index 0000000..a309709 --- /dev/null +++ b/Test/AOJ/Volume5/0516.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/MaxCumulativeSum.py + title: Math/MaxCumulativeSum.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0516 + links: + - https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0516 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0516\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Math import MaxCumulativeSum\n\ + \ndef main():\n while True:\n n, k = map(int, input().split())\n \ + \ if (n, k) == (0, 0):\n exit()\n a = [int(input()) for\ + \ _ in range(n)]\n ans = MaxCumulativeSum.MaxCumulativeSum(a, k)\n\n \ + \ print(max(ans))\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/MaxCumulativeSum.py + isVerificationFile: true + path: Test/AOJ/Volume5/0516.test.py + requiredBy: [] + timestamp: '2023-06-29 17:50:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/AOJ/Volume5/0516.test.py +layout: document +redirect_from: +- /verify/Test/AOJ/Volume5/0516.test.py +- /verify/Test/AOJ/Volume5/0516.test.py.html +title: Test/AOJ/Volume5/0516.test.py +--- diff --git a/Test/yosupo/DataStructure/AssociativeArray.py b/Test/yosupo/DataStructure/AssociativeArray.py deleted file mode 100644 index 345b370..0000000 --- a/Test/yosupo/DataStructure/AssociativeArray.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://judge.yosupo.jp/problem/associative_array - -from collections import defaultdict -import sys -input = sys.stdin.readline - -def main() -> None: - d = defaultdict(int) - - Q = int(input()) - for _ in range(Q): - query = list(map(int, input().split())) - if query[0] == 0: - d[query[1]] = query[2] - elif query[0] == 1: - print(d[query[1]]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yosupo/DataStructure/AssociativeArray.py.md b/Test/yosupo/DataStructure/AssociativeArray.py.md new file mode 100644 index 0000000..6f681da --- /dev/null +++ b/Test/yosupo/DataStructure/AssociativeArray.py.md @@ -0,0 +1,38 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + PROBLEM: https://judge.yosupo.jp/problem/associative_array + links: + - https://judge.yosupo.jp/problem/associative_array + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.yosupo.jp/problem/associative_array\n\ + \nfrom collections import defaultdict\nimport sys\ninput = sys.stdin.readline\n\ + \ndef main() -> None:\n d = defaultdict(int)\n\n Q = int(input())\n for\ + \ _ in range(Q):\n query = list(map(int, input().split()))\n if\ + \ query[0] == 0:\n d[query[1]] = query[2]\n elif query[0] ==\ + \ 1:\n print(d[query[1]])\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Test/yosupo/DataStructure/AssociativeArray.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Test/yosupo/DataStructure/AssociativeArray.py +layout: document +redirect_from: +- /library/Test/yosupo/DataStructure/AssociativeArray.py +- /library/Test/yosupo/DataStructure/AssociativeArray.py.html +title: Test/yosupo/DataStructure/AssociativeArray.py +--- diff --git a/Test/yosupo/DataStructure/StaticRMQ.test.py b/Test/yosupo/DataStructure/StaticRMQ.test.py deleted file mode 100644 index b50b894..0000000 --- a/Test/yosupo/DataStructure/StaticRMQ.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://judge.yosupo.jp/problem/staticrmq - -import sys -input = sys.stdin.readline - -sys.path.append("../../../") - -from Tree import RangeMinimamQuery - -def main(): - N, Q = map(int,input().split()) - a = list(map(int,input().split())) - seg = RangeMinimamQuery.SegTree(a, float('inf')) - - for _ in range(Q): - l, r = map(int, input().split()) - print(seg.query(l, r)) - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yosupo/DataStructure/StaticRMQ.test.py.md b/Test/yosupo/DataStructure/StaticRMQ.test.py.md new file mode 100644 index 0000000..54af80b --- /dev/null +++ b/Test/yosupo/DataStructure/StaticRMQ.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Tree/RangeMinimamQuery.py + title: Tree/RangeMinimamQuery.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.yosupo.jp/problem/staticrmq + links: + - https://judge.yosupo.jp/problem/staticrmq + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.yosupo.jp/problem/staticrmq\n\ + \nimport sys\ninput = sys.stdin.readline\n\nsys.path.append(\"../../../\")\n\n\ + from Tree import RangeMinimamQuery\n\ndef main():\n N, Q = map(int,input().split())\n\ + \ a = list(map(int,input().split()))\n seg = RangeMinimamQuery.SegTree(a,\ + \ float('inf'))\n\n for _ in range(Q):\n l, r = map(int, input().split())\n\ + \ print(seg.query(l, r))\n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Tree/RangeMinimamQuery.py + isVerificationFile: true + path: Test/yosupo/DataStructure/StaticRMQ.test.py + requiredBy: [] + timestamp: '2022-08-11 00:02:49+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yosupo/DataStructure/StaticRMQ.test.py +layout: document +redirect_from: +- /verify/Test/yosupo/DataStructure/StaticRMQ.test.py +- /verify/Test/yosupo/DataStructure/StaticRMQ.test.py.html +title: Test/yosupo/DataStructure/StaticRMQ.test.py +--- diff --git a/Test/yosupo/DataStructure/Unionfind.test.py b/Test/yosupo/DataStructure/Unionfind.test.py deleted file mode 100644 index c6778b2..0000000 --- a/Test/yosupo/DataStructure/Unionfind.test.py +++ /dev/null @@ -1,21 +0,0 @@ -# verification-helper: PROBLEM https://judge.yosupo.jp/problem/unionfind - -import sys -sys.path.append("../../../") - -from Tree import UnionFindTree - -def main(): - n, q = map(int, input().split()) - - uf = UnionFindTree.UnionFind(n) - - for _ in range(q): - t, u, v = map(int, input().split()) - if t == 0: - uf.merge(u, v) - elif t == 1: - print(int(uf.same(u, v))) - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yosupo/DataStructure/Unionfind.test.py.md b/Test/yosupo/DataStructure/Unionfind.test.py.md new file mode 100644 index 0000000..4dd0c05 --- /dev/null +++ b/Test/yosupo/DataStructure/Unionfind.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Tree/UnionFindTree.py + title: Tree/UnionFindTree.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.yosupo.jp/problem/unionfind + links: + - https://judge.yosupo.jp/problem/unionfind + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.yosupo.jp/problem/unionfind\n\ + \nimport sys\nsys.path.append(\"../../../\")\n\nfrom Tree import UnionFindTree\n\ + \ndef main():\n n, q = map(int, input().split())\n\n uf = UnionFindTree.UnionFind(n)\n\ + \n for _ in range(q):\n t, u, v = map(int, input().split())\n \ + \ if t == 0:\n uf.merge(u, v)\n elif t == 1:\n print(int(uf.same(u,\ + \ v)))\n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Tree/UnionFindTree.py + isVerificationFile: true + path: Test/yosupo/DataStructure/Unionfind.test.py + requiredBy: [] + timestamp: '2024-04-23 12:17:37+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yosupo/DataStructure/Unionfind.test.py +layout: document +redirect_from: +- /verify/Test/yosupo/DataStructure/Unionfind.test.py +- /verify/Test/yosupo/DataStructure/Unionfind.test.py.html +title: Test/yosupo/DataStructure/Unionfind.test.py +--- diff --git a/Test/yosupo/Sample/A+B.test.py b/Test/yosupo/Sample/A+B.test.py deleted file mode 100644 index 9b15835..0000000 --- a/Test/yosupo/Sample/A+B.test.py +++ /dev/null @@ -1,9 +0,0 @@ -# verification-helper: PROBLEM https://judge.yosupo.jp/problem/aplusb - -def main() -> None: - A, B = map(int, input().split()) - print(A + B) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yosupo/Sample/A+B.test.py.md b/Test/yosupo/Sample/A+B.test.py.md new file mode 100644 index 0000000..a20b293 --- /dev/null +++ b/Test/yosupo/Sample/A+B.test.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.yosupo.jp/problem/aplusb + links: + - https://judge.yosupo.jp/problem/aplusb + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.yosupo.jp/problem/aplusb\n\n\ + def main() -> None:\n A, B = map(int, input().split())\n print(A + B)\n\n\ + \nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yosupo/Sample/A+B.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yosupo/Sample/A+B.test.py +layout: document +redirect_from: +- /verify/Test/yosupo/Sample/A+B.test.py +- /verify/Test/yosupo/Sample/A+B.test.py.html +title: Test/yosupo/Sample/A+B.test.py +--- diff --git a/Test/yosupo/Sample/ManyA+B.test.py b/Test/yosupo/Sample/ManyA+B.test.py deleted file mode 100644 index f7074e7..0000000 --- a/Test/yosupo/Sample/ManyA+B.test.py +++ /dev/null @@ -1,13 +0,0 @@ -# verification-helper: PROBLEM https://judge.yosupo.jp/problem/many_aplusb - -def main() -> None: - - T = int(input()) - - for _ in range(T): - A, B = map(int, input().split()) - print(A + B) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yosupo/Sample/ManyA+B.test.py.md b/Test/yosupo/Sample/ManyA+B.test.py.md new file mode 100644 index 0000000..2f001d7 --- /dev/null +++ b/Test/yosupo/Sample/ManyA+B.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://judge.yosupo.jp/problem/many_aplusb + links: + - https://judge.yosupo.jp/problem/many_aplusb + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://judge.yosupo.jp/problem/many_aplusb\n\ + \ndef main() -> None:\n\n T = int(input())\n\n for _ in range(T):\n \ + \ A, B = map(int, input().split())\n print(A + B)\n\n\nif __name__ ==\ + \ \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yosupo/Sample/ManyA+B.test.py + requiredBy: [] + timestamp: '2023-06-29 00:35:03+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yosupo/Sample/ManyA+B.test.py +layout: document +redirect_from: +- /verify/Test/yosupo/Sample/ManyA+B.test.py +- /verify/Test/yosupo/Sample/ManyA+B.test.py.html +title: Test/yosupo/Sample/ManyA+B.test.py +--- diff --git a/Test/yukicoder/0001.test.py b/Test/yukicoder/0001.test.py deleted file mode 100644 index d6dbabb..0000000 --- a/Test/yukicoder/0001.test.py +++ /dev/null @@ -1,46 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1 - -from collections import defaultdict - -def main() -> None: - - n = int(input()) - c = int(input()) - v = int(input()) - s = list(map(int, input().split())) - t = list(map(int, input().split())) - y = list(map(int, input().split())) - m = list(map(int, input().split())) - - INF = 10 ** 18 - d_time = defaultdict(list) # d_time[i_j] := iからjへかかる時間 - d_cost = defaultdict(list) # d_cost[i_j] := iからjへかかるコスト - - for i in range(v): - d_time[f'{s[i]}_{t[i]}'].append(m[i]) - d_cost[f'{s[i]}_{t[i]}'].append(y[i]) - - # dp[i][j] := i番目の町にいて、かかったコストがjである時のかかった時間の最小値 - # dp[i][j] = min(dp[i][j], dp[k][j - y[j]] + c[j]) (1 <= k < i) - - dp = [[INF] * (c + 1) for _ in range(n + 1)] - for j in range(c + 1): - dp[1][j] = 0 - - for i in range(1, n + 1): - for k in range(1, i): - for j in range(c + 1): - for p, q in zip(d_cost[f'{k}_{i}'], d_time[f'{k}_{i}']): - if j - p >= 0: - # k -> iに行く場合の更新路があるか考える。 (k < i) - dp[i][j] = min(dp[i][j], dp[k][j - p] + q) - - ans = INF - for j in range(c + 1): - ans = min(ans, dp[-1][j]) - - print(ans) if ans != INF else print(-1) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0001.test.py.md b/Test/yukicoder/0001.test.py.md new file mode 100644 index 0000000..13e64b6 --- /dev/null +++ b/Test/yukicoder/0001.test.py.md @@ -0,0 +1,54 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1 + links: + - https://yukicoder.me/problems/no/1 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1\n\nfrom\ + \ collections import defaultdict\n\ndef main() -> None:\n\n n = int(input())\n\ + \ c = int(input())\n v = int(input())\n s = list(map(int, input().split()))\n\ + \ t = list(map(int, input().split()))\n y = list(map(int, input().split()))\n\ + \ m = list(map(int, input().split()))\n\n INF = 10 ** 18\n d_time = defaultdict(list)\ + \ # d_time[i_j] := i\u304B\u3089j\u3078\u304B\u304B\u308B\u6642\u9593\n d_cost\ + \ = defaultdict(list) # d_cost[i_j] := i\u304B\u3089j\u3078\u304B\u304B\u308B\u30B3\ + \u30B9\u30C8\n\n for i in range(v):\n d_time[f'{s[i]}_{t[i]}'].append(m[i])\n\ + \ d_cost[f'{s[i]}_{t[i]}'].append(y[i])\n\n # dp[i][j] := i\u756A\u76EE\ + \u306E\u753A\u306B\u3044\u3066\u3001\u304B\u304B\u3063\u305F\u30B3\u30B9\u30C8\ + \u304Cj\u3067\u3042\u308B\u6642\u306E\u304B\u304B\u3063\u305F\u6642\u9593\u306E\ + \u6700\u5C0F\u5024\n # dp[i][j] = min(dp[i][j], dp[k][j - y[j]] + c[j]) (1\ + \ <= k < i)\n\n dp = [[INF] * (c + 1) for _ in range(n + 1)]\n for j in\ + \ range(c + 1):\n dp[1][j] = 0\n\n for i in range(1, n + 1):\n \ + \ for k in range(1, i):\n for j in range(c + 1):\n \ + \ for p, q in zip(d_cost[f'{k}_{i}'], d_time[f'{k}_{i}']):\n \ + \ if j - p >= 0:\n # k -> i\u306B\u884C\u304F\u5834\u5408\ + \u306E\u66F4\u65B0\u8DEF\u304C\u3042\u308B\u304B\u8003\u3048\u308B\u3002 (k <\ + \ i)\n dp[i][j] = min(dp[i][j], dp[k][j - p] + q)\n\n \ + \ ans = INF\n for j in range(c + 1):\n ans = min(ans, dp[-1][j])\n\ + \n print(ans) if ans != INF else print(-1)\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0001.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0001.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0001.test.py +- /verify/Test/yukicoder/0001.test.py.html +title: Test/yukicoder/0001.test.py +--- diff --git a/Test/yukicoder/0002.test.py b/Test/yukicoder/0002.test.py deleted file mode 100644 index 556d623..0000000 --- a/Test/yukicoder/0002.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2 - -import sys -sys.path.append("../../") - -from Math import Factorization - -def main() -> None: - n = int(input()) - a = Factorization.factorization(n) - - or_ = 0 - for i in range(len(a)): - or_ ^= a[i][1] - - print("Alice") if or_ != 0 else print("Bob") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0002.test.py.md b/Test/yukicoder/0002.test.py.md new file mode 100644 index 0000000..ac6beb5 --- /dev/null +++ b/Test/yukicoder/0002.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Factorization.py + title: Math/Factorization.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2 + links: + - https://yukicoder.me/problems/no/2 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2\n\nimport\ + \ sys\nsys.path.append(\"../../\")\n\nfrom Math import Factorization\n\ndef main()\ + \ -> None:\n n = int(input())\n a = Factorization.factorization(n)\n\n \ + \ or_ = 0\n for i in range(len(a)):\n or_ ^= a[i][1]\n\n print(\"\ + Alice\") if or_ != 0 else print(\"Bob\")\n\n\nif __name__ == \"__main__\":\n \ + \ main()" + dependsOn: + - Math/Factorization.py + isVerificationFile: true + path: Test/yukicoder/0002.test.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0002.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0002.test.py +- /verify/Test/yukicoder/0002.test.py.html +title: Test/yukicoder/0002.test.py +--- diff --git a/Test/yukicoder/0003.test.py b/Test/yukicoder/0003.test.py deleted file mode 100644 index 2cbb7fe..0000000 --- a/Test/yukicoder/0003.test.py +++ /dev/null @@ -1,36 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/3 - -from collections import deque - -def main() -> None: - - n = int(input()) - - dist = [0] * (n + 1) - dist[1] = 1 - - q = deque([1]) - while q: - v = q.popleft() - cnt = 0 - for i in range(60): - if v >> i & 1: - cnt += 1 - - a = v - cnt - if 1 <= a <= n: - if dist[a] == 0: - dist[a] = dist[v] + 1 - q.append(a) - - b = v + cnt - if 1 <= b <= n: - if dist[b] == 0: - dist[b] = dist[v] + 1 - q.append(b) - - print(dist[-1]) if dist[-1] != 0 else print(-1) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0003.test.py.md b/Test/yukicoder/0003.test.py.md new file mode 100644 index 0000000..ca3f26f --- /dev/null +++ b/Test/yukicoder/0003.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/3 + links: + - https://yukicoder.me/problems/no/3 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/3\n\nfrom\ + \ collections import deque\n\ndef main() -> None:\n\n n = int(input())\n\n\ + \ dist = [0] * (n + 1)\n dist[1] = 1\n\n q = deque([1])\n while q:\n\ + \ v = q.popleft()\n cnt = 0\n for i in range(60):\n \ + \ if v >> i & 1:\n cnt += 1\n\n a = v - cnt\n \ + \ if 1 <= a <= n:\n if dist[a] == 0:\n dist[a] =\ + \ dist[v] + 1\n q.append(a)\n\n b = v + cnt\n if\ + \ 1 <= b <= n:\n if dist[b] == 0:\n dist[b] = dist[v]\ + \ + 1\n q.append(b)\n\n print(dist[-1]) if dist[-1] != 0 else\ + \ print(-1)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0003.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0003.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0003.test.py +- /verify/Test/yukicoder/0003.test.py.html +title: Test/yukicoder/0003.test.py +--- diff --git a/Test/yukicoder/0004.test.py b/Test/yukicoder/0004.test.py deleted file mode 100644 index 4c1b0e2..0000000 --- a/Test/yukicoder/0004.test.py +++ /dev/null @@ -1,25 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/4 - -def main() -> None: - - n = int(input()) - w = list(map(int, input().split())) - - if sum(w) % 2: - print('impossible') - else: - t = 10 ** 4 + 10 - dp = [[False] * t for _ in range(n + 1)] - # dp[i][j] := i番目までの重りでjを作れるかどうか - dp[0][0] = True - for i in range(n): - for j in range(t): - if j - w[i] >= 0: - dp[i + 1][j] |= dp[i][j - w[i]] - dp[i + 1][j] |= dp[i][j] - - print('possible') if dp[-1][sum(w) // 2] else print('impossible') - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0004.test.py.md b/Test/yukicoder/0004.test.py.md new file mode 100644 index 0000000..2ae2cbe --- /dev/null +++ b/Test/yukicoder/0004.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/4 + links: + - https://yukicoder.me/problems/no/4 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/4\n\ndef\ + \ main() -> None:\n\n n = int(input())\n w = list(map(int, input().split()))\n\ + \n if sum(w) % 2:\n print('impossible')\n else:\n t = 10 **\ + \ 4 + 10\n dp = [[False] * t for _ in range(n + 1)]\n # dp[i][j]\ + \ := i\u756A\u76EE\u307E\u3067\u306E\u91CD\u308A\u3067j\u3092\u4F5C\u308C\u308B\ + \u304B\u3069\u3046\u304B\n dp[0][0] = True\n for i in range(n):\n\ + \ for j in range(t):\n if j - w[i] >= 0:\n \ + \ dp[i + 1][j] |= dp[i][j - w[i]]\n dp[i + 1][j] |= dp[i][j]\n\ + \ \n print('possible') if dp[-1][sum(w) // 2] else print('impossible')\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0004.test.py + requiredBy: [] + timestamp: '2023-07-01 01:32:50+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0004.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0004.test.py +- /verify/Test/yukicoder/0004.test.py.html +title: Test/yukicoder/0004.test.py +--- diff --git a/Test/yukicoder/0005.test.py b/Test/yukicoder/0005.test.py deleted file mode 100644 index a5faf5e..0000000 --- a/Test/yukicoder/0005.test.py +++ /dev/null @@ -1,17 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/5 - -def main() -> None: - - l = int(input()) - n = int(input()) - w = sorted(list(map(int, input().split()))) - ans = 0 - for i in range(n): - ans += w[i] - if ans > l: - exit(print(i)) - print(n) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0005.test.py.md b/Test/yukicoder/0005.test.py.md new file mode 100644 index 0000000..d0b0f78 --- /dev/null +++ b/Test/yukicoder/0005.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/5 + links: + - https://yukicoder.me/problems/no/5 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/5\n\ndef\ + \ main() -> None:\n\n l = int(input())\n n = int(input())\n w = sorted(list(map(int,\ + \ input().split())))\n ans = 0\n for i in range(n):\n ans += w[i]\n\ + \ if ans > l:\n exit(print(i))\n print(n)\n\n\nif __name__\ + \ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0005.test.py + requiredBy: [] + timestamp: '2023-07-01 01:32:50+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0005.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0005.test.py +- /verify/Test/yukicoder/0005.test.py.html +title: Test/yukicoder/0005.test.py +--- diff --git a/Test/yukicoder/0007.test.py b/Test/yukicoder/0007.test.py deleted file mode 100644 index 938c7f7..0000000 --- a/Test/yukicoder/0007.test.py +++ /dev/null @@ -1,30 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/7 - -import sys -sys.path.append("../../") - -from Math import SieveOfEratosthenes - -def main() -> None: - - n = int(input()) - primes_list = SieveOfEratosthenes.primes(n) - - # dp[i] := 残りが i の時にあなたが勝つか - dp = [False] * (n + 1) - dp[0] = True - dp[1] = True - for i in range(2, n + 1): - check = False - for j in primes_list: - if 0 <= i - j <= n: - if dp[i - j] == False: - check = True - - dp[i] = check - - print("Win") if dp[n] else print("Lose") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0007.test.py.md b/Test/yukicoder/0007.test.py.md new file mode 100644 index 0000000..d9dce28 --- /dev/null +++ b/Test/yukicoder/0007.test.py.md @@ -0,0 +1,46 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/SieveOfEratosthenes.py + title: Math/SieveOfEratosthenes.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/7 + links: + - https://yukicoder.me/problems/no/7 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/7\n\nimport\ + \ sys\nsys.path.append(\"../../\")\n\nfrom Math import SieveOfEratosthenes\n\n\ + def main() -> None:\n\n n = int(input())\n primes_list = SieveOfEratosthenes.primes(n)\n\ + \n # dp[i] := \u6B8B\u308A\u304C i \u306E\u6642\u306B\u3042\u306A\u305F\u304C\ + \u52DD\u3064\u304B\n dp = [False] * (n + 1)\n dp[0] = True\n dp[1] =\ + \ True\n for i in range(2, n + 1):\n check = False\n for j in\ + \ primes_list:\n if 0 <= i - j <= n:\n if dp[i - j]\ + \ == False:\n check = True\n \n dp[i] = check\n\ + \ \n print(\"Win\") if dp[n] else print(\"Lose\")\n\n\nif __name__ == \"\ + __main__\":\n main()" + dependsOn: + - Math/SieveOfEratosthenes.py + isVerificationFile: true + path: Test/yukicoder/0007.test.py + requiredBy: [] + timestamp: '2023-07-01 01:32:50+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0007.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0007.test.py +- /verify/Test/yukicoder/0007.test.py.html +title: Test/yukicoder/0007.test.py +--- diff --git a/Test/yukicoder/0008.test.py b/Test/yukicoder/0008.test.py deleted file mode 100644 index cf1caed..0000000 --- a/Test/yukicoder/0008.test.py +++ /dev/null @@ -1,16 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/8 - -def main() -> None: - p = int(input()) - for _ in range(p): - n, k = map(int, input().split()) - if n <= k: - print("Win") - elif (n - 1) % (k + 1) == 0: - print("Lose") - else: - print("Win") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0008.test.py.md b/Test/yukicoder/0008.test.py.md new file mode 100644 index 0000000..862b40b --- /dev/null +++ b/Test/yukicoder/0008.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/8 + links: + - https://yukicoder.me/problems/no/8 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/8\n\ndef\ + \ main() -> None:\n p = int(input())\n for _ in range(p):\n n, k\ + \ = map(int, input().split())\n if n <= k:\n print(\"Win\")\n\ + \ elif (n - 1) % (k + 1) == 0:\n print(\"Lose\")\n else:\n\ + \ print(\"Win\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0008.test.py + requiredBy: [] + timestamp: '2023-07-01 01:32:50+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0008.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0008.test.py +- /verify/Test/yukicoder/0008.test.py.html +title: Test/yukicoder/0008.test.py +--- diff --git a/Test/yukicoder/0009.test.py b/Test/yukicoder/0009.test.py deleted file mode 100644 index 461881d..0000000 --- a/Test/yukicoder/0009.test.py +++ /dev/null @@ -1,33 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/9 - -from heapq import heapify, heappop, heappush - -def main() -> None: - - n = int(input()) - a = list(map(int, input().split())) - b = list(map(int, input().split())) - - ans = [] - for start in range(n): - q = [] - heapify(q) - for i in range(n): - heappush(q, (a[i], 0)) - - for i in range(n): - p, num = heappop(q) - p += b[(start + i) % n] // 2 - heappush(q, (p, num + 1)) - - ma = 0 - for i in range(n): - ma = max(ma, heappop(q)[1]) - - ans.append(ma) - - print(min(ans)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0009.test.py.md b/Test/yukicoder/0009.test.py.md new file mode 100644 index 0000000..39923c8 --- /dev/null +++ b/Test/yukicoder/0009.test.py.md @@ -0,0 +1,42 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/9 + links: + - https://yukicoder.me/problems/no/9 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/9\n\nfrom\ + \ heapq import heapify, heappop, heappush\n\ndef main() -> None:\n\n n = int(input())\n\ + \ a = list(map(int, input().split()))\n b = list(map(int, input().split()))\n\ + \n ans = []\n for start in range(n):\n q = []\n heapify(q)\n\ + \ for i in range(n):\n heappush(q, (a[i], 0))\n \n \ + \ for i in range(n):\n p, num = heappop(q)\n p += b[(start\ + \ + i) % n] // 2\n heappush(q, (p, num + 1))\n\n ma = 0\n \ + \ for i in range(n):\n ma = max(ma, heappop(q)[1])\n \n\ + \ ans.append(ma)\n\n print(min(ans))\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0009.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0009.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0009.test.py +- /verify/Test/yukicoder/0009.test.py.html +title: Test/yukicoder/0009.test.py +--- diff --git a/Test/yukicoder/0015.test.py b/Test/yukicoder/0015.test.py deleted file mode 100644 index f908f43..0000000 --- a/Test/yukicoder/0015.test.py +++ /dev/null @@ -1,54 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/9 -# verification-helper: IGNORE - -from itertools import product -from bisect import bisect_right - -def main() -> None: - - n, s = map(int, input().split()) - p = [int(input()) for _ in range(n)] - - cnt = min(20, n) - item1 = [] - bisect_item1 = [] - for i in product([0, 1], repeat=cnt): - money, item = 0, [] - for j in range(cnt): - if i[j] == 1: - money += p[j] - item.append(j + 1) - item1.append([money, item]) - bisect_item1.append(money) - - cnt = max(0, n - 20) - item2 = [] - bisect_item2 = [] - for i in product([0, 1], repeat=cnt): - money, item = 0, [] - for j in range(cnt): - if i[j] == 1: - money += p[j + 20] - item.append(j + 21) - item2.append([money, item]) - bisect_item2.append(money) - - item2.sort(key=lambda x: x[0]) - bisect_item2.sort() - - ans = [] - for money, item in item1: - if money > s: continue - p = bisect_right(bisect_item2, s - money) - if money + bisect_item2[p - 1] == s: - a = item - b = item2[p - 1][1] - ans.append(sorted(a + b)) - - ans.sort() - for i in ans: - print(*i) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0015.test.py.md b/Test/yukicoder/0015.test.py.md new file mode 100644 index 0000000..47dd294 --- /dev/null +++ b/Test/yukicoder/0015.test.py.md @@ -0,0 +1,50 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + IGNORE: '' + PROBLEM: https://yukicoder.me/problems/no/9 + links: + - https://yukicoder.me/problems/no/9 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/9\n# verification-helper:\ + \ IGNORE\n\nfrom itertools import product\nfrom bisect import bisect_right\n\n\ + def main() -> None:\n\n n, s = map(int, input().split())\n p = [int(input())\ + \ for _ in range(n)]\n\n cnt = min(20, n)\n item1 = []\n bisect_item1\ + \ = []\n for i in product([0, 1], repeat=cnt):\n money, item = 0, []\n\ + \ for j in range(cnt):\n if i[j] == 1:\n money\ + \ += p[j]\n item.append(j + 1)\n item1.append([money, item])\n\ + \ bisect_item1.append(money)\n\n cnt = max(0, n - 20)\n item2 = []\n\ + \ bisect_item2 = []\n for i in product([0, 1], repeat=cnt):\n money,\ + \ item = 0, []\n for j in range(cnt):\n if i[j] == 1:\n \ + \ money += p[j + 20]\n item.append(j + 21)\n \ + \ item2.append([money, item])\n bisect_item2.append(money)\n\n item2.sort(key=lambda\ + \ x: x[0])\n bisect_item2.sort()\n\n ans = []\n for money, item in item1:\n\ + \ if money > s: continue\n p = bisect_right(bisect_item2, s - money)\n\ + \ if money + bisect_item2[p - 1] == s:\n a = item\n \ + \ b = item2[p - 1][1]\n ans.append(sorted(a + b))\n\n ans.sort()\n\ + \ for i in ans:\n print(*i)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0015.test.py + requiredBy: [] + timestamp: '2023-07-01 01:49:57+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/yukicoder/0015.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0015.test.py +- /verify/Test/yukicoder/0015.test.py.html +title: Test/yukicoder/0015.test.py +--- diff --git a/Test/yukicoder/0044.test.py b/Test/yukicoder/0044.test.py deleted file mode 100644 index 8cda9b8..0000000 --- a/Test/yukicoder/0044.test.py +++ /dev/null @@ -1,19 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/44 - - -def main() -> None: - - n = int(input()) - - dp = [0] * (n + 1) - dp[0] = 1 - dp[1] = 1 - for i in range(2, n + 1): - dp[i] = dp[i - 1] + dp[i - 2] - - - print(dp[n]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0044.test.py.md b/Test/yukicoder/0044.test.py.md new file mode 100644 index 0000000..cc8364d --- /dev/null +++ b/Test/yukicoder/0044.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/44 + links: + - https://yukicoder.me/problems/no/44 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/44\n\n\n\ + def main() -> None:\n\n n = int(input())\n\n dp = [0] * (n + 1)\n dp[0]\ + \ = 1\n dp[1] = 1\n for i in range(2, n + 1):\n dp[i] = dp[i - 1]\ + \ + dp[i - 2]\n \n\n print(dp[n])\n\n\nif __name__ == \"__main__\":\n \ + \ main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0044.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0044.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0044.test.py +- /verify/Test/yukicoder/0044.test.py.html +title: Test/yukicoder/0044.test.py +--- diff --git a/Test/yukicoder/0053.test.py b/Test/yukicoder/0053.test.py deleted file mode 100644 index 870a2e1..0000000 --- a/Test/yukicoder/0053.test.py +++ /dev/null @@ -1,10 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/53 -# verification-helper: ERROR 1e-9 - -def main() -> None: - n = int(input()) - print(4 * pow(0.75, n)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0053.test.py.md b/Test/yukicoder/0053.test.py.md new file mode 100644 index 0000000..2d9f420 --- /dev/null +++ b/Test/yukicoder/0053.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + ERROR: 1e-9 + PROBLEM: https://yukicoder.me/problems/no/53 + links: + - https://yukicoder.me/problems/no/53 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/53\n# verification-helper:\ + \ ERROR 1e-9\n\ndef main() -> None:\n n = int(input())\n print(4 * pow(0.75,\ + \ n))\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0053.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0053.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0053.test.py +- /verify/Test/yukicoder/0053.test.py.html +title: Test/yukicoder/0053.test.py +--- diff --git a/Test/yukicoder/0064.test.py b/Test/yukicoder/0064.test.py deleted file mode 100644 index 9715e70..0000000 --- a/Test/yukicoder/0064.test.py +++ /dev/null @@ -1,10 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/64 - -def main() -> None: - f0, f1, n = map(int, input().split()) - a = [f0, f1, f0 ^ f1] - print(a[n % 3]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0064.test.py.md b/Test/yukicoder/0064.test.py.md new file mode 100644 index 0000000..faa2743 --- /dev/null +++ b/Test/yukicoder/0064.test.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/64 + links: + - https://yukicoder.me/problems/no/64 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/64\n\ndef\ + \ main() -> None:\n f0, f1, n = map(int, input().split())\n a = [f0, f1,\ + \ f0 ^ f1]\n print(a[n % 3])\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0064.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0064.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0064.test.py +- /verify/Test/yukicoder/0064.test.py.html +title: Test/yukicoder/0064.test.py +--- diff --git a/Test/yukicoder/0167.test.py b/Test/yukicoder/0167.test.py deleted file mode 100644 index f51a1e7..0000000 --- a/Test/yukicoder/0167.test.py +++ /dev/null @@ -1,15 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/167 - -import sys -sys.set_int_max_str_digits(10**9) - -def main() -> None: - - n = int(input()) - m = int(input()) - - print(pow(n, m, 10)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0167.test.py.md b/Test/yukicoder/0167.test.py.md new file mode 100644 index 0000000..cfb7e81 --- /dev/null +++ b/Test/yukicoder/0167.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/167 + links: + - https://yukicoder.me/problems/no/167 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/167\n\nimport\ + \ sys\nsys.set_int_max_str_digits(10**9)\n\ndef main() -> None:\n\n n = int(input())\n\ + \ m = int(input())\n\n print(pow(n, m, 10))\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0167.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0167.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0167.test.py +- /verify/Test/yukicoder/0167.test.py.html +title: Test/yukicoder/0167.test.py +--- diff --git a/Test/yukicoder/0182.test.py b/Test/yukicoder/0182.test.py deleted file mode 100644 index d5b4ed8..0000000 --- a/Test/yukicoder/0182.test.py +++ /dev/null @@ -1,16 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/182 - -from collections import defaultdict - -n = int(input()) -a = list(map(int, input().split())) - -d = defaultdict(int) -for i in range(n): - d[a[i]] += 1 - -ans = 0 -for i in d.values(): - ans += i == 1 - -print(ans) \ No newline at end of file diff --git a/Test/yukicoder/0182.test.py.md b/Test/yukicoder/0182.test.py.md new file mode 100644 index 0000000..c0f596f --- /dev/null +++ b/Test/yukicoder/0182.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/182 + links: + - https://yukicoder.me/problems/no/182 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/182\n\nfrom\ + \ collections import defaultdict\n\nn = int(input())\na = list(map(int, input().split()))\n\ + \nd = defaultdict(int)\nfor i in range(n):\n d[a[i]] += 1\n\nans = 0\nfor i\ + \ in d.values():\n ans += i == 1\n\nprint(ans)" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0182.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0182.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0182.test.py +- /verify/Test/yukicoder/0182.test.py.html +title: Test/yukicoder/0182.test.py +--- diff --git a/Test/yukicoder/0204.test.py b/Test/yukicoder/0204.test.py deleted file mode 100644 index 7148737..0000000 --- a/Test/yukicoder/0204.test.py +++ /dev/null @@ -1,33 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/204 - - -def main() -> None: - d = int(input()) - c1 = input() - c2 = input() - s = "x" * 14 + c1 + c2 + "x" * 14 - ans = 0 - for i in range(27): - if i + d > 42: - continue - p = [i for i in s] - cnt = 0 - for j in range(d): - if p[i + j] == "x": - cnt += 1 - p[i + j] = "o" - if cnt <= d: - num = 0 - for i in range(42): - if p[i] == "o": - num += 1 - else: - ans = max(ans, num) - num = 0 - ans = max(ans, num) - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0204.test.py.md b/Test/yukicoder/0204.test.py.md new file mode 100644 index 0000000..5caf118 --- /dev/null +++ b/Test/yukicoder/0204.test.py.md @@ -0,0 +1,43 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/204 + links: + - https://yukicoder.me/problems/no/204 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/204\n\n\n\ + def main() -> None:\n d = int(input())\n c1 = input()\n c2 = input()\n\ + \ s = \"x\" * 14 + c1 + c2 + \"x\" * 14\n ans = 0\n for i in range(27):\n\ + \ if i + d > 42:\n continue\n p = [i for i in s]\n \ + \ cnt = 0\n for j in range(d):\n if p[i + j] == \"x\":\n\ + \ cnt += 1 \n p[i + j] = \"o\"\n if cnt\ + \ <= d:\n num = 0\n for i in range(42):\n \ + \ if p[i] == \"o\":\n num += 1\n else:\n \ + \ ans = max(ans, num)\n num = 0\n \ + \ ans = max(ans, num)\n \n print(ans)\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0204.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/yukicoder/0204.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0204.test.py +- /verify/Test/yukicoder/0204.test.py.html +title: Test/yukicoder/0204.test.py +--- diff --git a/Test/yukicoder/0208.test.py b/Test/yukicoder/0208.test.py deleted file mode 100644 index 3c2cfb0..0000000 --- a/Test/yukicoder/0208.test.py +++ /dev/null @@ -1,14 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/208 - -def main() -> None: - x, y = map(int, input().split()) - x2, y2 = map(int, input().split()) - - if x == y and x2 == y2 and x2 < x: - print(max(x, y) + 1) - else: - print(max(x, y)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0208.test.py.md b/Test/yukicoder/0208.test.py.md new file mode 100644 index 0000000..6d4b00c --- /dev/null +++ b/Test/yukicoder/0208.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/208 + links: + - https://yukicoder.me/problems/no/208 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/208\n\ndef\ + \ main() -> None:\n x, y = map(int, input().split())\n x2, y2 = map(int,\ + \ input().split())\n\n if x == y and x2 == y2 and x2 < x:\n print(max(x,\ + \ y) + 1)\n else:\n print(max(x, y))\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0208.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0208.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0208.test.py +- /verify/Test/yukicoder/0208.test.py.html +title: Test/yukicoder/0208.test.py +--- diff --git a/Test/yukicoder/0244.test.py b/Test/yukicoder/0244.test.py deleted file mode 100644 index 32fd66a..0000000 --- a/Test/yukicoder/0244.test.py +++ /dev/null @@ -1,10 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/244 - -def main() -> None: - n = int(input()) - - print(n - 1) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0244.test.py.md b/Test/yukicoder/0244.test.py.md new file mode 100644 index 0000000..efc66ef --- /dev/null +++ b/Test/yukicoder/0244.test.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/244 + links: + - https://yukicoder.me/problems/no/244 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/244\n\ndef\ + \ main() -> None:\n n = int(input())\n\n print(n - 1)\n\n\nif __name__ ==\ + \ \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0244.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0244.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0244.test.py +- /verify/Test/yukicoder/0244.test.py.html +title: Test/yukicoder/0244.test.py +--- diff --git a/Test/yukicoder/0314.test.py b/Test/yukicoder/0314.test.py deleted file mode 100644 index c80058e..0000000 --- a/Test/yukicoder/0314.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/314 - -def main() -> None: - n = int(input()) - - dp = [[0] * 3 for _ in range(n + 1)] - dp[1][1] = 1 - mod = 10**9 + 7 - - for i in range(2, n + 1): - dp[i][0] = dp[i - 1][1] + dp[i - 1][2] - dp[i][1] = dp[i - 1][0] - dp[i][2] = dp[i - 1][1] - for j in range(3): - dp[i][j] %= mod - - print(sum(dp[n]) % mod) - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0314.test.py.md b/Test/yukicoder/0314.test.py.md new file mode 100644 index 0000000..afedf32 --- /dev/null +++ b/Test/yukicoder/0314.test.py.md @@ -0,0 +1,39 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/314 + links: + - https://yukicoder.me/problems/no/314 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/314\n\ndef\ + \ main() -> None:\n n = int(input())\n \n dp = [[0] * 3 for _ in range(n\ + \ + 1)]\n dp[1][1] = 1\n mod = 10**9 + 7\n\n for i in range(2, n + 1):\n\ + \ dp[i][0] = dp[i - 1][1] + dp[i - 1][2]\n dp[i][1] = dp[i - 1][0]\n\ + \ dp[i][2] = dp[i - 1][1]\n for j in range(3):\n dp[i][j]\ + \ %= mod\n \n print(sum(dp[n]) % mod)\n\nif __name__ == \"__main__\":\n\ + \ main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0314.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0314.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0314.test.py +- /verify/Test/yukicoder/0314.test.py.html +title: Test/yukicoder/0314.test.py +--- diff --git a/Test/yukicoder/0451.test.py b/Test/yukicoder/0451.test.py deleted file mode 100644 index e1f880f..0000000 --- a/Test/yukicoder/0451.test.py +++ /dev/null @@ -1,31 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/451 - -def main() -> None: - n = int(input()) - b = [int(input()) for _ in range(n)] - i, mid = 0, 0 - a = [1] * (n + 1) - while i < n: - if i % 2: - a[i + 1] = a[i] - b[i] - else: - a[i + 1] = b[i] - a[i] - - if a[i + 1] <= 0 or a[i + 1] > 10**18: - a[0] += 1 - a[i + 1] - i = -1 - mid += 1 - if mid == 10: - exit(print(-1)) - i += 1 - - if a[0] <= 0: - exit(print(-1)) - - print(n + 1) - for i in range(n + 1): - print(a[i]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0451.test.py.md b/Test/yukicoder/0451.test.py.md new file mode 100644 index 0000000..3709e33 --- /dev/null +++ b/Test/yukicoder/0451.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/451 + links: + - https://yukicoder.me/problems/no/451 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/451\n\ndef\ + \ main() -> None:\n n = int(input())\n b = [int(input()) for _ in range(n)]\n\ + \ i, mid = 0, 0\n a = [1] * (n + 1)\n while i < n:\n if i % 2:\n\ + \ a[i + 1] = a[i] - b[i]\n else:\n a[i + 1] = b[i]\ + \ - a[i]\n \n if a[i + 1] <= 0 or a[i + 1] > 10**18:\n \ + \ a[0] += 1 - a[i + 1]\n i = -1\n mid += 1\n if\ + \ mid == 10:\n exit(print(-1))\n i += 1\n \n if a[0] <=\ + \ 0:\n exit(print(-1))\n \n print(n + 1)\n for i in range(n +\ + \ 1):\n print(a[i])\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0451.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/yukicoder/0451.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0451.test.py +- /verify/Test/yukicoder/0451.test.py.html +title: Test/yukicoder/0451.test.py +--- diff --git a/Test/yukicoder/0677.test.py b/Test/yukicoder/0677.test.py deleted file mode 100644 index 61e9db4..0000000 --- a/Test/yukicoder/0677.test.py +++ /dev/null @@ -1,10 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/677 - -n = int(input()) - -ans = [] -for i in range(n + 1): - for j in range(n + 1): - ans.append(2 ** i * 5 ** j) - -print(*sorted(ans), sep='\n') \ No newline at end of file diff --git a/Test/yukicoder/0677.test.py.md b/Test/yukicoder/0677.test.py.md new file mode 100644 index 0000000..d0dce32 --- /dev/null +++ b/Test/yukicoder/0677.test.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/677 + links: + - https://yukicoder.me/problems/no/677 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/677\n\nn\ + \ = int(input())\n\nans = []\nfor i in range(n + 1):\n for j in range(n + 1):\n\ + \ ans.append(2 ** i * 5 ** j)\n\nprint(*sorted(ans), sep='\\n')" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0677.test.py + requiredBy: [] + timestamp: '2023-04-18 14:48:46+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0677.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0677.test.py +- /verify/Test/yukicoder/0677.test.py.html +title: Test/yukicoder/0677.test.py +--- diff --git a/Test/yukicoder/0697.test.py b/Test/yukicoder/0697.test.py deleted file mode 100644 index f469f96..0000000 --- a/Test/yukicoder/0697.test.py +++ /dev/null @@ -1,51 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/697 - -import sys -sys.path.append("../../") - -from collections import deque - -h, w = map(int, input().split()) -a = [list(map(int, input().split())) for _ in range(h)] - -# dist[i][j] := INF -> 池でまだ見てない, -1 -> 地面で通れない -dist = [[-1] * w for _ in range(h)] -for i in range(h): - for j in range(w): - if a[i][j]: - dist[i][j] = 0 - -cnt = 1 # 今見ている池の番号 -q = deque() -for i in range(h): - for j in range(w): - if a[i][j]: - q.append((i, j)) - dist[i][j] = cnt - break - break - -d = ((1, 0), (-1, 0), (0, 1), (0, -1)) -for i in range(h): - for j in range(w): - if not (dist[i][j] == 0 or dist[i][j] == cnt): continue - if dist[i][j] == 0: - q.append((i, j)) - while q: - vy, vx = q.popleft() - dist[vy][vx] = cnt - for dy, dx in d: - y = vy + dy - x = vx + dx - if not (0 <= x < w and 0 <= y < h): continue - if dist[y][x] != 0: continue - dist[y][x] = dist[vy][vx] - q.append((y, x)) - cnt += 1 - -ans = 0 -for i in range(h): - for j in range(w): - ans = max(ans, dist[i][j]) - -print(ans) \ No newline at end of file diff --git a/Test/yukicoder/0697.test.py.md b/Test/yukicoder/0697.test.py.md new file mode 100644 index 0000000..17e034f --- /dev/null +++ b/Test/yukicoder/0697.test.py.md @@ -0,0 +1,50 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/697 + links: + - https://yukicoder.me/problems/no/697 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/697\n\nimport\ + \ sys\nsys.path.append(\"../../\")\n\nfrom collections import deque\n\nh, w =\ + \ map(int, input().split())\na = [list(map(int, input().split())) for _ in range(h)]\n\ + \n# dist[i][j] := INF -> \u6C60\u3067\u307E\u3060\u898B\u3066\u306A\u3044, -1\ + \ -> \u5730\u9762\u3067\u901A\u308C\u306A\u3044\ndist = [[-1] * w for _ in range(h)]\n\ + for i in range(h):\n for j in range(w):\n if a[i][j]:\n dist[i][j]\ + \ = 0\n\ncnt = 1 # \u4ECA\u898B\u3066\u3044\u308B\u6C60\u306E\u756A\u53F7\nq =\ + \ deque()\nfor i in range(h):\n for j in range(w):\n if a[i][j]:\n \ + \ q.append((i, j))\n dist[i][j] = cnt\n break\n\ + \ break\n\nd = ((1, 0), (-1, 0), (0, 1), (0, -1))\nfor i in range(h):\n \ + \ for j in range(w):\n if not (dist[i][j] == 0 or dist[i][j] == cnt): continue\n\ + \ if dist[i][j] == 0:\n q.append((i, j))\n while q:\n\ + \ vy, vx = q.popleft()\n dist[vy][vx] = cnt\n \ + \ for dy, dx in d:\n y = vy + dy\n x = vx + dx\n\ + \ if not (0 <= x < w and 0 <= y < h): continue\n \ + \ if dist[y][x] != 0: continue\n dist[y][x] = dist[vy][vx]\n \ + \ q.append((y, x))\n cnt += 1\n\nans = 0\nfor i in range(h):\n\ + \ for j in range(w):\n ans = max(ans, dist[i][j])\n\nprint(ans)" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0697.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0697.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0697.test.py +- /verify/Test/yukicoder/0697.test.py.html +title: Test/yukicoder/0697.test.py +--- diff --git a/Test/yukicoder/0713.test.py b/Test/yukicoder/0713.test.py deleted file mode 100644 index 4849aab..0000000 --- a/Test/yukicoder/0713.test.py +++ /dev/null @@ -1,14 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/713 - -import sys -sys.path.append("../../") - -from Math import SieveOfEratosthenes - - -def main() -> None: - print(sum(SieveOfEratosthenes.primes(int(input())))) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0713.test.py.md b/Test/yukicoder/0713.test.py.md new file mode 100644 index 0000000..efb3e4d --- /dev/null +++ b/Test/yukicoder/0713.test.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/SieveOfEratosthenes.py + title: Math/SieveOfEratosthenes.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/713 + links: + - https://yukicoder.me/problems/no/713 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/713\n\nimport\ + \ sys\nsys.path.append(\"../../\")\n\nfrom Math import SieveOfEratosthenes\n\n\ + \ndef main() -> None:\n print(sum(SieveOfEratosthenes.primes(int(input()))))\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/SieveOfEratosthenes.py + isVerificationFile: true + path: Test/yukicoder/0713.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0713.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0713.test.py +- /verify/Test/yukicoder/0713.test.py.html +title: Test/yukicoder/0713.test.py +--- diff --git a/Test/yukicoder/0786.test.py b/Test/yukicoder/0786.test.py deleted file mode 100644 index de1aee5..0000000 --- a/Test/yukicoder/0786.test.py +++ /dev/null @@ -1,15 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/786 - -def main() -> None: - n = int(input()) - dp = [0] * (n + 1) - dp[1] = 1 - dp[2] = 2 - for i in range(3, n + 1): - dp[i] = dp[i - 1] + dp[i - 2] - - print(dp[n]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/0786.test.py.md b/Test/yukicoder/0786.test.py.md new file mode 100644 index 0000000..16aac08 --- /dev/null +++ b/Test/yukicoder/0786.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: true + _pathExtension: py + _verificationStatusIcon: ':x:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/786 + links: + - https://yukicoder.me/problems/no/786 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/786\n\ndef\ + \ main() -> None:\n n = int(input())\n dp = [0] * (n + 1)\n dp[1] = 1\n\ + \ dp[2] = 2\n for i in range(3, n + 1):\n dp[i] = dp[i - 1] + dp[i\ + \ - 2]\n \n print(dp[n])\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/0786.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_WRONG_ANSWER + verifiedWith: [] +documentation_of: Test/yukicoder/0786.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0786.test.py +- /verify/Test/yukicoder/0786.test.py.html +title: Test/yukicoder/0786.test.py +--- diff --git a/Test/yukicoder/0847.test.py b/Test/yukicoder/0847.test.py deleted file mode 100644 index 0ea8433..0000000 --- a/Test/yukicoder/0847.test.py +++ /dev/null @@ -1,36 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/847 - -import sys -sys.path.append("../../") - -from Math import Factorization - -def dfs(a: list, now: int): - - global ans - - if len(a) == l and now <= m: - ans += 1 - return - - for i in range(fac[len(a)][1] + 1): - - now *= fac[len(a)][0] ** i - - if now <= m: - dfs(a + [i], now) - now //= fac[len(a)][0] ** i - else: - return - -n, k, m = map(int, input().split()) - -fac = Factorization.factorization(n) -l = len(fac) - -for i in range(l): - fac[i][1] *= k - -ans = 0 -dfs([], 1) -print(ans) \ No newline at end of file diff --git a/Test/yukicoder/0847.test.py.md b/Test/yukicoder/0847.test.py.md new file mode 100644 index 0000000..57ff1bb --- /dev/null +++ b/Test/yukicoder/0847.test.py.md @@ -0,0 +1,45 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Factorization.py + title: Math/Factorization.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/847 + links: + - https://yukicoder.me/problems/no/847 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/847\n\nimport\ + \ sys\nsys.path.append(\"../../\")\n\nfrom Math import Factorization\n\ndef dfs(a:\ + \ list, now: int):\n \n global ans\n\n if len(a) == l and now <= m:\n\ + \ ans += 1\n return\n\n for i in range(fac[len(a)][1] + 1):\n\ + \n now *= fac[len(a)][0] ** i\n\n if now <= m:\n dfs(a\ + \ + [i], now)\n now //= fac[len(a)][0] ** i\n else:\n \ + \ return\n\nn, k, m = map(int, input().split())\n\nfac = Factorization.factorization(n)\n\ + l = len(fac)\n\nfor i in range(l):\n fac[i][1] *= k\n\nans = 0\ndfs([], 1)\n\ + print(ans)" + dependsOn: + - Math/Factorization.py + isVerificationFile: true + path: Test/yukicoder/0847.test.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/0847.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/0847.test.py +- /verify/Test/yukicoder/0847.test.py.html +title: Test/yukicoder/0847.test.py +--- diff --git a/Test/yukicoder/1003.test.py b/Test/yukicoder/1003.test.py deleted file mode 100644 index a4e5f49..0000000 --- a/Test/yukicoder/1003.test.py +++ /dev/null @@ -1,8 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1003 - -def main() -> None: - print("Yes") if not int(input()) % 6 else print("No") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1003.test.py.md b/Test/yukicoder/1003.test.py.md new file mode 100644 index 0000000..a19e7d9 --- /dev/null +++ b/Test/yukicoder/1003.test.py.md @@ -0,0 +1,35 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1003 + links: + - https://yukicoder.me/problems/no/1003 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1003\n\n\ + def main() -> None:\n print(\"Yes\") if not int(input()) % 6 else print(\"\ + No\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/1003.test.py + requiredBy: [] + timestamp: '2023-06-29 15:39:20+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1003.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1003.test.py +- /verify/Test/yukicoder/1003.test.py.html +title: Test/yukicoder/1003.test.py +--- diff --git a/Test/yukicoder/1155.test.py b/Test/yukicoder/1155.test.py deleted file mode 100644 index 84be95d..0000000 --- a/Test/yukicoder/1155.test.py +++ /dev/null @@ -1,10 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1155 - -def main() -> None: - place = ["Shiitakerando", "Otsukakokusaibijutsukan", "Spring-8"] - - print(place[int(input()) - 1]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1155.test.py.md b/Test/yukicoder/1155.test.py.md new file mode 100644 index 0000000..42b9f2d --- /dev/null +++ b/Test/yukicoder/1155.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1155 + links: + - https://yukicoder.me/problems/no/1155 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1155\n\n\ + def main() -> None:\n place = [\"Shiitakerando\", \"Otsukakokusaibijutsukan\"\ + , \"Spring-8\"]\n\n print(place[int(input()) - 1])\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/1155.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1155.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1155.test.py +- /verify/Test/yukicoder/1155.test.py.html +title: Test/yukicoder/1155.test.py +--- diff --git a/Test/yukicoder/1367.test.py b/Test/yukicoder/1367.test.py deleted file mode 100644 index 34b7acd..0000000 --- a/Test/yukicoder/1367.test.py +++ /dev/null @@ -1,17 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1367 - -def main() -> None: - s = input() - t = "kadomatsu" - ind = 0 - for i in range(9): - if s[ind] == t[i]: - ind += 1 - if ind == len(s): - exit(print("Yes")) - - print("No") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1367.test.py.md b/Test/yukicoder/1367.test.py.md new file mode 100644 index 0000000..8f38f26 --- /dev/null +++ b/Test/yukicoder/1367.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1367 + links: + - https://yukicoder.me/problems/no/1367 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1367\n\n\ + def main() -> None:\n s = input()\n t = \"kadomatsu\"\n ind = 0\n \ + \ for i in range(9):\n if s[ind] == t[i]:\n ind += 1\n \ + \ if ind == len(s):\n exit(print(\"Yes\"))\n \n print(\"No\"\ + )\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/1367.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1367.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1367.test.py +- /verify/Test/yukicoder/1367.test.py.html +title: Test/yukicoder/1367.test.py +--- diff --git a/Test/yukicoder/1454.test.py b/Test/yukicoder/1454.test.py deleted file mode 100644 index c4e4817..0000000 --- a/Test/yukicoder/1454.test.py +++ /dev/null @@ -1,26 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1454 - -def main() -> None: - n, m, x, y = map(int, input().split()) - a = list(map(int, input().split())) - - p = [] - for i in range(n): - if a[i] <= y: - continue - p.append(a[i]) - - n = len(p) - if n <= m: - print(sum(p)) - else: - p.sort() - for i in range(n - m): - if p[i] >= x: - exit(print("Handicapped")) - p.sort(reverse=True) - print(sum(p[:m])) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1454.test.py.md b/Test/yukicoder/1454.test.py.md new file mode 100644 index 0000000..be2f91c --- /dev/null +++ b/Test/yukicoder/1454.test.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1454 + links: + - https://yukicoder.me/problems/no/1454 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1454\n\n\ + def main() -> None:\n n, m, x, y = map(int, input().split())\n a = list(map(int,\ + \ input().split()))\n\n p = []\n for i in range(n):\n if a[i] <=\ + \ y:\n continue\n p.append(a[i])\n \n n = len(p)\n \ + \ if n <= m:\n print(sum(p))\n else:\n p.sort()\n for\ + \ i in range(n - m):\n if p[i] >= x:\n exit(print(\"\ + Handicapped\"))\n p.sort(reverse=True)\n print(sum(p[:m]))\n\n\n\ + if __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/1454.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1454.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1454.test.py +- /verify/Test/yukicoder/1454.test.py.html +title: Test/yukicoder/1454.test.py +--- diff --git a/Test/yukicoder/1639.test.py b/Test/yukicoder/1639.test.py deleted file mode 100644 index b96fd0e..0000000 --- a/Test/yukicoder/1639.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1639 - -import sys -sys.path.append("../../") - -from Graph import Kruskal - -n = int(input()) - -g = [] -for _ in range(n * (n - 1) // 2): - a, b, c = map(int, input().split()) - a -= 1 - b -= 1 - g.append((a, b, c)) - -kruskal = Kruskal.Kruskal(n, g) -ans = kruskal.cost(g) - -print(max(ans)) \ No newline at end of file diff --git a/Test/yukicoder/1639.test.py.md b/Test/yukicoder/1639.test.py.md new file mode 100644 index 0000000..81c5a97 --- /dev/null +++ b/Test/yukicoder/1639.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Graph/Kruskal.py + title: Graph/Kruskal.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1639 + links: + - https://yukicoder.me/problems/no/1639 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1639\n\n\ + import sys\nsys.path.append(\"../../\")\n\nfrom Graph import Kruskal\n\nn = int(input())\n\ + \ng = []\nfor _ in range(n * (n - 1) // 2):\n a, b, c = map(int, input().split())\n\ + \ a -= 1\n b -= 1\n g.append((a, b, c))\n\nkruskal = Kruskal.Kruskal(n,\ + \ g)\nans = kruskal.cost(g)\n\nprint(max(ans))" + dependsOn: + - Graph/Kruskal.py + isVerificationFile: true + path: Test/yukicoder/1639.test.py + requiredBy: [] + timestamp: '2022-08-11 00:02:49+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1639.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1639.test.py +- /verify/Test/yukicoder/1639.test.py.html +title: Test/yukicoder/1639.test.py +--- diff --git a/Test/yukicoder/1737.test.py b/Test/yukicoder/1737.test.py deleted file mode 100644 index 37c7207..0000000 --- a/Test/yukicoder/1737.test.py +++ /dev/null @@ -1,22 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1737 - -import sys -sys.path.append("../../") - -from Math import Factorization - -def main() -> None: - n = int(input()) - - if n == 1: - exit(print(0)) - - ans = 0 - for i, j in Factorization.factorization(n): - ans += i * j - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1737.test.py.md b/Test/yukicoder/1737.test.py.md new file mode 100644 index 0000000..e15d50d --- /dev/null +++ b/Test/yukicoder/1737.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Factorization.py + title: Math/Factorization.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1737 + links: + - https://yukicoder.me/problems/no/1737 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1737\n\n\ + import sys\nsys.path.append(\"../../\")\n\nfrom Math import Factorization\n\n\ + def main() -> None:\n n = int(input())\n\n if n == 1:\n exit(print(0))\n\ + \n ans = 0\n for i, j in Factorization.factorization(n):\n ans +=\ + \ i * j\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: + - Math/Factorization.py + isVerificationFile: true + path: Test/yukicoder/1737.test.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1737.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1737.test.py +- /verify/Test/yukicoder/1737.test.py.html +title: Test/yukicoder/1737.test.py +--- diff --git a/Test/yukicoder/1749.test.py b/Test/yukicoder/1749.test.py deleted file mode 100644 index 672e9e7..0000000 --- a/Test/yukicoder/1749.test.py +++ /dev/null @@ -1,30 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1749 - -def main() -> None: - n, m, t = map(int, input().split()) - - g = [[] for _ in range(n)] - for _ in range(m): - x, y = map(int, input().split()) - g[x].append(y) - g[y].append(x) - mod = 998244353 - - # dp[i][j] := i 日目に都市 j で感染している人数の合計 - dp = [[0] * (n + 1) for _ in range(t + 1)] - dp[0][0] = 1 - for i in range(1, t + 1): - for j in range(n): - cnt = 0 - for nxt in g[j]: - cnt += dp[i - 1][nxt] - cnt %= mod - - dp[i][j] = cnt - dp[i][j] %= mod - - print(dp[t][0]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1749.test.py.md b/Test/yukicoder/1749.test.py.md new file mode 100644 index 0000000..6ab630f --- /dev/null +++ b/Test/yukicoder/1749.test.py.md @@ -0,0 +1,43 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1749 + links: + - https://yukicoder.me/problems/no/1749 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1749\n\n\ + def main() -> None:\n n, m, t = map(int, input().split())\n \n g = [[]\ + \ for _ in range(n)]\n for _ in range(m):\n x, y = map(int, input().split())\n\ + \ g[x].append(y)\n g[y].append(x)\n mod = 998244353\n\n #\ + \ dp[i][j] := i \u65E5\u76EE\u306B\u90FD\u5E02 j \u3067\u611F\u67D3\u3057\u3066\ + \u3044\u308B\u4EBA\u6570\u306E\u5408\u8A08\n dp = [[0] * (n + 1) for _ in range(t\ + \ + 1)]\n dp[0][0] = 1\n for i in range(1, t + 1):\n for j in range(n):\n\ + \ cnt = 0\n for nxt in g[j]:\n cnt += dp[i\ + \ - 1][nxt]\n cnt %= mod\n\n dp[i][j] = cnt\n \ + \ dp[i][j] %= mod\n\n print(dp[t][0])\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/1749.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1749.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1749.test.py +- /verify/Test/yukicoder/1749.test.py.html +title: Test/yukicoder/1749.test.py +--- diff --git a/Test/yukicoder/1808.test.py b/Test/yukicoder/1808.test.py deleted file mode 100644 index 9ca2d90..0000000 --- a/Test/yukicoder/1808.test.py +++ /dev/null @@ -1,35 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/1808 - -def is_ok(k: int) -> bool: - check = True - cnt = 0 - for i in range(n): - cnt += a[i] - if cnt >= k * (i + 1): continue - check = False - - return check - - -def binary_search(left: int, right: int) -> int: - while right - left > 1: - mid = (left + right) // 2 - if is_ok(mid): - left = mid - else: - right = mid - - return left - - -def main(): - global n, a - - n, m = map(int, input().split()) - a = list(map(int, input().split())) - - print(binary_search(-1, 10**18) // m) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/1808.test.py.md b/Test/yukicoder/1808.test.py.md new file mode 100644 index 0000000..bbec6fd --- /dev/null +++ b/Test/yukicoder/1808.test.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/1808 + links: + - https://yukicoder.me/problems/no/1808 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/1808\n\n\ + def is_ok(k: int) -> bool:\n check = True\n cnt = 0\n for i in range(n):\n\ + \ cnt += a[i]\n if cnt >= k * (i + 1): continue\n check =\ + \ False\n\n return check\n\n\ndef binary_search(left: int, right: int) -> int:\n\ + \ while right - left > 1:\n mid = (left + right) // 2\n if is_ok(mid):\n\ + \ left = mid\n else:\n right = mid\n\n return\ + \ left\n\n\ndef main():\n global n, a\n\n n, m = map(int, input().split())\n\ + \ a = list(map(int, input().split()))\n\n print(binary_search(-1, 10**18)\ + \ // m)\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/1808.test.py + requiredBy: [] + timestamp: '2023-04-18 20:40:05+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/1808.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/1808.test.py +- /verify/Test/yukicoder/1808.test.py.html +title: Test/yukicoder/1808.test.py +--- diff --git a/Test/yukicoder/2034.test.py b/Test/yukicoder/2034.test.py deleted file mode 100644 index 7c2c6a9..0000000 --- a/Test/yukicoder/2034.test.py +++ /dev/null @@ -1,18 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2034 - -from collections import defaultdict - -n = int(input()) -s = input() - -d = defaultdict(int) -rev_d = defaultdict(int) -for i, j in enumerate("abcdefghijklmnopqrstuvwxyz"): - d[j] = i - rev_d[i] = j - -ans = [] -for i in s: - ans.append(rev_d[26 - d[i] - 1]) - -print(*ans, sep='') \ No newline at end of file diff --git a/Test/yukicoder/2034.test.py.md b/Test/yukicoder/2034.test.py.md new file mode 100644 index 0000000..d245db0 --- /dev/null +++ b/Test/yukicoder/2034.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2034 + links: + - https://yukicoder.me/problems/no/2034 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2034\n\n\ + from collections import defaultdict\n\nn = int(input())\ns = input()\n\nd = defaultdict(int)\n\ + rev_d = defaultdict(int)\nfor i, j in enumerate(\"abcdefghijklmnopqrstuvwxyz\"\ + ):\n d[j] = i\n rev_d[i] = j\n\nans = []\nfor i in s:\n ans.append(rev_d[26\ + \ - d[i] - 1])\n\nprint(*ans, sep='')" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2034.test.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2034.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2034.test.py +- /verify/Test/yukicoder/2034.test.py.html +title: Test/yukicoder/2034.test.py +--- diff --git a/Test/yukicoder/2093.test.py b/Test/yukicoder/2093.test.py deleted file mode 100644 index 9145806..0000000 --- a/Test/yukicoder/2093.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2093 - -def main() -> None: - N, I = map(int, input().split()) - s, a = [0] * N, [0] * N - for i in range(N): - s[i], a[i] = map(int, input().split()) - - dp = [[0] * (I + 1) for _ in range(N + 1)] - for i in range(1, N + 1): - for j in range(I + 1): - if 0 <= j - s[i - 1] <= I: - dp[i][j] = max(dp[i][j], dp[i - 1][j - s[i - 1]] + a[i - 1]) - dp[i][j] = max(dp[i][j], dp[i - 1][j]) - - print(dp[N][I]) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2093.test.py.md b/Test/yukicoder/2093.test.py.md new file mode 100644 index 0000000..5ae7bf6 --- /dev/null +++ b/Test/yukicoder/2093.test.py.md @@ -0,0 +1,40 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2093 + links: + - https://yukicoder.me/problems/no/2093 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2093\n\n\ + def main() -> None:\n N, I = map(int, input().split())\n s, a = [0] * N,\ + \ [0] * N\n for i in range(N):\n s[i], a[i] = map(int, input().split())\n\ + \ \n dp = [[0] * (I + 1) for _ in range(N + 1)]\n for i in range(1, N\ + \ + 1):\n for j in range(I + 1):\n if 0 <= j - s[i - 1] <= I:\n\ + \ dp[i][j] = max(dp[i][j], dp[i - 1][j - s[i - 1]] + a[i - 1])\n\ + \ dp[i][j] = max(dp[i][j], dp[i - 1][j])\n \n print(dp[N][I])\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2093.test.py + requiredBy: [] + timestamp: '2023-06-29 15:39:20+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2093.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2093.test.py +- /verify/Test/yukicoder/2093.test.py.html +title: Test/yukicoder/2093.test.py +--- diff --git a/Test/yukicoder/2371.test.py b/Test/yukicoder/2371.test.py deleted file mode 100644 index f60a58f..0000000 --- a/Test/yukicoder/2371.test.py +++ /dev/null @@ -1,16 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2371 - -def main() -> None: - h, m = map(int, input().split()) - time = h * 60 + m - - if time <= 7 * 60 + 29: - print("Yes") - elif time <= 8 * 60 + 29: - print("Late") - else: - print("No") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2371.test.py.md b/Test/yukicoder/2371.test.py.md new file mode 100644 index 0000000..aa35ef9 --- /dev/null +++ b/Test/yukicoder/2371.test.py.md @@ -0,0 +1,37 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2371 + links: + - https://yukicoder.me/problems/no/2371 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2371\n\n\ + def main() -> None:\n h, m = map(int, input().split())\n time = h * 60 +\ + \ m\n\n if time <= 7 * 60 + 29:\n print(\"Yes\")\n elif time <= 8\ + \ * 60 + 29:\n print(\"Late\")\n else:\n print(\"No\")\n\n\n\ + if __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2371.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2371.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2371.test.py +- /verify/Test/yukicoder/2371.test.py.html +title: Test/yukicoder/2371.test.py +--- diff --git a/Test/yukicoder/2373.test.py b/Test/yukicoder/2373.test.py deleted file mode 100644 index 5b129b8..0000000 --- a/Test/yukicoder/2373.test.py +++ /dev/null @@ -1,42 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2373 - -def main() -> None: - n = int(input()) - s = list(input()) - dp = [[False] * 4 for _ in range(n + 1)] - # 0 := w, 1 := a, 2 := o, 3 := n - if s[0] == "w": - dp[1][0] = True - if s[0] == "n": - dp[1][3] = True - if s[0] == "?": - dp[1][0] = True - dp[1][3] = True - - for i in range(2, n + 1): - if dp[i - 1][0]: - if s[i - 1] == "a" or s[i - 1] == "?": - dp[i][1] = True - if s[i - 1] == "o" or s[i - 1] == "?": - dp[i][2] = True - if dp[i - 1][1]: - if s[i - 1] == "w" or s[i - 1] == "?": - dp[i][0] = True - if s[i - 1] == "n" or s[i - 1] == "?": - dp[i][3] = True - if dp[i - 1][2]: - if s[i - 1] == "w" or s[i - 1] == "?": - dp[i][0] = True - if s[i - 1] == "n" or s[i - 1] == "?": - dp[i][3] = True - if dp[i - 1][3]: - if s[i - 1] == "w" or s[i - 1] == "?": - dp[i][0] = True - if s[i - 1] == "n" or s[i - 1] == "?": - dp[i][3] = True - - print("Yes") if dp[n][1] or dp[n][2] or dp[n][3] else print("No") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2373.test.py.md b/Test/yukicoder/2373.test.py.md new file mode 100644 index 0000000..4516e2f --- /dev/null +++ b/Test/yukicoder/2373.test.py.md @@ -0,0 +1,50 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2373 + links: + - https://yukicoder.me/problems/no/2373 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2373\n\n\ + def main() -> None:\n n = int(input())\n s = list(input())\n dp = [[False]\ + \ * 4 for _ in range(n + 1)]\n # 0 := w, 1 := a, 2 := o, 3 := n\n if s[0]\ + \ == \"w\":\n dp[1][0] = True\n if s[0] == \"n\":\n dp[1][3]\ + \ = True\n if s[0] == \"?\":\n dp[1][0] = True\n dp[1][3] = True\n\ + \ \n for i in range(2, n + 1):\n if dp[i - 1][0]:\n if\ + \ s[i - 1] == \"a\" or s[i - 1] == \"?\":\n dp[i][1] = True\n \ + \ if s[i - 1] == \"o\" or s[i - 1] == \"?\":\n dp[i][2]\ + \ = True\n if dp[i - 1][1]:\n if s[i - 1] == \"w\" or s[i -\ + \ 1] == \"?\":\n dp[i][0] = True\n if s[i - 1] == \"\ + n\" or s[i - 1] == \"?\":\n dp[i][3] = True\n if dp[i -\ + \ 1][2]:\n if s[i - 1] == \"w\" or s[i - 1] == \"?\":\n \ + \ dp[i][0] = True\n if s[i - 1] == \"n\" or s[i - 1] == \"?\":\n\ + \ dp[i][3] = True\n if dp[i - 1][3]:\n if s[i\ + \ - 1] == \"w\" or s[i - 1] == \"?\":\n dp[i][0] = True\n \ + \ if s[i - 1] == \"n\" or s[i - 1] == \"?\":\n dp[i][3] =\ + \ True\n\n print(\"Yes\") if dp[n][1] or dp[n][2] or dp[n][3] else print(\"\ + No\")\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2373.test.py + requiredBy: [] + timestamp: '2023-07-09 23:09:33+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2373.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2373.test.py +- /verify/Test/yukicoder/2373.test.py.html +title: Test/yukicoder/2373.test.py +--- diff --git a/Test/yukicoder/2557.test.py b/Test/yukicoder/2557.test.py deleted file mode 100644 index 79fd129..0000000 --- a/Test/yukicoder/2557.test.py +++ /dev/null @@ -1,13 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2557 - -def main() -> None: - N = int(input()) - - if N < 1200: - print("green") - else: - print("difficult") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2557.test.py.md b/Test/yukicoder/2557.test.py.md new file mode 100644 index 0000000..4d5de31 --- /dev/null +++ b/Test/yukicoder/2557.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2557 + links: + - https://yukicoder.me/problems/no/2557 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2557\n\n\ + def main() -> None:\n N = int(input())\n\n if N < 1200:\n print(\"\ + green\")\n else:\n print(\"difficult\")\n\n\nif __name__ == \"__main__\"\ + :\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2557.test.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2557.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2557.test.py +- /verify/Test/yukicoder/2557.test.py.html +title: Test/yukicoder/2557.test.py +--- diff --git a/Test/yukicoder/2558.test.py b/Test/yukicoder/2558.test.py deleted file mode 100644 index 9f8fc15..0000000 --- a/Test/yukicoder/2558.test.py +++ /dev/null @@ -1,12 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2558 - -def main() -> None: - A, B, a, b = map(int, input().split()) - for x in range(A * B + 1): - if x % A == a and x % B == b: - print(x) - exit() - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2558.test.py.md b/Test/yukicoder/2558.test.py.md new file mode 100644 index 0000000..98bd8cc --- /dev/null +++ b/Test/yukicoder/2558.test.py.md @@ -0,0 +1,36 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2558 + links: + - https://yukicoder.me/problems/no/2558 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2558\n\n\ + def main() -> None:\n A, B, a, b = map(int, input().split())\n for x in\ + \ range(A * B + 1):\n if x % A == a and x % B == b:\n print(x)\n\ + \ exit()\n\n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2558.test.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2558.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2558.test.py +- /verify/Test/yukicoder/2558.test.py.html +title: Test/yukicoder/2558.test.py +--- diff --git a/Test/yukicoder/2559.test.py b/Test/yukicoder/2559.test.py deleted file mode 100644 index 1f8a8e0..0000000 --- a/Test/yukicoder/2559.test.py +++ /dev/null @@ -1,20 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2559 - -def main() -> None: - N, X = map(int, input().split()) - A, B = [0] * N, [0] * N - for i in range(N): - A[i], B[i] = map(int, input().split()) - - ans = [] - for j in range(1, X + 1): - cnt = 0 - for i in range(N): - cnt = max(cnt, max(B[i] - abs(j - A[i]), 0)) - ans.append(cnt) - - print(*ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2559.test.py.md b/Test/yukicoder/2559.test.py.md new file mode 100644 index 0000000..cb395d3 --- /dev/null +++ b/Test/yukicoder/2559.test.py.md @@ -0,0 +1,39 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2559 + links: + - https://yukicoder.me/problems/no/2559 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2559\n\n\ + def main() -> None:\n N, X = map(int, input().split())\n A, B = [0] * N,\ + \ [0] * N\n for i in range(N):\n A[i], B[i] = map(int, input().split())\n\ + \ \n ans = []\n for j in range(1, X + 1):\n cnt = 0\n for\ + \ i in range(N):\n cnt = max(cnt, max(B[i] - abs(j - A[i]), 0))\n \ + \ ans.append(cnt)\n\n print(*ans)\n\n\nif __name__ == \"__main__\":\n\ + \ main()" + dependsOn: [] + isVerificationFile: true + path: Test/yukicoder/2559.test.py + requiredBy: [] + timestamp: '2023-12-02 20:13:06+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2559.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2559.test.py +- /verify/Test/yukicoder/2559.test.py.html +title: Test/yukicoder/2559.test.py +--- diff --git a/Test/yukicoder/2570.test.py b/Test/yukicoder/2570.test.py deleted file mode 100644 index cf1eb5a..0000000 --- a/Test/yukicoder/2570.test.py +++ /dev/null @@ -1,29 +0,0 @@ -# verification-helper: PROBLEM https://yukicoder.me/problems/no/2570 - -import sys -sys.path.append("../../") - -from Math import Divisor - -def main() -> None: - N, K = map(int, input().split()) - A = list(map(int, input().split())) - - p = set() - for i in range(N): - for j in Divisor.divisors(A[i]): - p.add(j) - - ans = [] - for x in p: - cnt = 0 - for i in range(N): - cnt += min(A[i] % x, x - (A[i] % x)) - if cnt <= K: - ans.append(x) - - print(max(ans)) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Test/yukicoder/2570.test.py.md b/Test/yukicoder/2570.test.py.md new file mode 100644 index 0000000..e4baa95 --- /dev/null +++ b/Test/yukicoder/2570.test.py.md @@ -0,0 +1,44 @@ +--- +data: + _extendedDependsOn: + - icon: ':heavy_check_mark:' + path: Math/Divisor.py + title: Math/Divisor.py + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + PROBLEM: https://yukicoder.me/problems/no/2570 + links: + - https://yukicoder.me/problems/no/2570 + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# verification-helper: PROBLEM https://yukicoder.me/problems/no/2570\n\n\ + import sys\nsys.path.append(\"../../\")\n\nfrom Math import Divisor\n\ndef main()\ + \ -> None:\n N, K = map(int, input().split())\n A = list(map(int, input().split()))\n\ + \n p = set()\n for i in range(N):\n for j in Divisor.divisors(A[i]):\n\ + \ p.add(j)\n\n ans = []\n for x in p:\n cnt = 0\n \ + \ for i in range(N):\n cnt += min(A[i] % x, x - (A[i] % x))\n \ + \ if cnt <= K:\n ans.append(x)\n\n print(max(ans))\n\n\nif\ + \ __name__ == \"__main__\":\n main()" + dependsOn: + - Math/Divisor.py + isVerificationFile: true + path: Test/yukicoder/2570.test.py + requiredBy: [] + timestamp: '2023-12-02 20:24:38+09:00' + verificationStatus: TEST_ACCEPTED + verifiedWith: [] +documentation_of: Test/yukicoder/2570.test.py +layout: document +redirect_from: +- /verify/Test/yukicoder/2570.test.py +- /verify/Test/yukicoder/2570.test.py.html +title: Test/yukicoder/2570.test.py +--- diff --git a/Tree/BinaryIndexedTree.py b/Tree/BinaryIndexedTree.py deleted file mode 100644 index 0d2ffde..0000000 --- a/Tree/BinaryIndexedTree.py +++ /dev/null @@ -1,42 +0,0 @@ -""" -BITを行った後の数列は昇順になるので注意! -""" -import copy - -def BIT(A: list) -> int: - "転倒数を求める" - cnt = 0 - n = len(A) - if n > 1: - A1 = A[: n >> 1] - A2 = A[n >> 1 :] - cnt += BIT(A1) - cnt += BIT(A2) - i1, i2 = 0, 0 - for i in range(n): - if i2 == len(A2): - A[i] = A1[i1] - i1 += 1 - elif i1 == len(A1): - A[i] = A2[i2] - i2 += 1 - elif A1[i1] <= A2[i2]: - A[i] = A1[i1] - i1 += 1 - else: - A[i] = A2[i2] - i2 += 1 - cnt += n // 2 - i1 - - return cnt - - -def main() -> None: - a = [2, 15, 23, 32, 7, 19] - x = copy.copy(a) - ans = BIT(x) - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Tree/BinaryIndexedTree.py.md b/Tree/BinaryIndexedTree.py.md new file mode 100644 index 0000000..5537165 --- /dev/null +++ b/Tree/BinaryIndexedTree.py.md @@ -0,0 +1,43 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "\"\"\"\nBIT\u3092\u884C\u3063\u305F\u5F8C\u306E\u6570\u5217\u306F\u6607\u9806\ + \u306B\u306A\u308B\u306E\u3067\u6CE8\u610F\uFF01\n\"\"\"\nimport copy\n\ndef BIT(A:\ + \ list) -> int:\n \"\u8EE2\u5012\u6570\u3092\u6C42\u3081\u308B\"\n cnt =\ + \ 0\n n = len(A)\n if n > 1:\n A1 = A[: n >> 1]\n A2 = A[n\ + \ >> 1 :]\n cnt += BIT(A1)\n cnt += BIT(A2)\n i1, i2 = 0,\ + \ 0\n for i in range(n):\n if i2 == len(A2):\n \ + \ A[i] = A1[i1]\n i1 += 1\n elif i1 == len(A1):\n\ + \ A[i] = A2[i2]\n i2 += 1\n elif A1[i1]\ + \ <= A2[i2]:\n A[i] = A1[i1]\n i1 += 1\n \ + \ else:\n A[i] = A2[i2]\n i2 += 1\n \ + \ cnt += n // 2 - i1\n\n return cnt\n\n\ndef main() -> None:\n a\ + \ = [2, 15, 23, 32, 7, 19]\n x = copy.copy(a)\n ans = BIT(x)\n print(ans)\n\ + \n\nif __name__ == \"__main__\":\n main()" + dependsOn: [] + isVerificationFile: false + path: Tree/BinaryIndexedTree.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Tree/BinaryIndexedTree.py +layout: document +redirect_from: +- /library/Tree/BinaryIndexedTree.py +- /library/Tree/BinaryIndexedTree.py.html +title: Tree/BinaryIndexedTree.py +--- diff --git a/Tree/FindCenter.py b/Tree/FindCenter.py deleted file mode 100644 index 442745f..0000000 --- a/Tree/FindCenter.py +++ /dev/null @@ -1,53 +0,0 @@ -# 木の中心を求める O(N) -# 1-indexedで表された木の中心となりうる頂点の集合を改行区切りで出力します。 -from collections import deque -from collections import defaultdict - -def bfs(s: int) -> tuple: - "幅優先探索を行い、頂点 s からの距離を求める" - dist = [10000] * N - dist[s] = 0 - q = deque([s]) - - vertexmemo = defaultdict(list) - vertexmemo[0].append(s) - while q: - v = q.popleft() - for nxt in g[v]: - if dist[nxt] == 10000: - dist[nxt] = dist[v] + 1 - vertexmemo[dist[nxt]].append(nxt) - q.append(nxt) - - return dist, vertexmemo - -N = int(input()) - -g = [[] for _ in range(N)] -for _ in range(N - 1): - a, b = map(int, input().split()) - a -= 1 - b -= 1 - g[a].append(b) - g[b].append(a) - -dist, vmap = bfs(0) - -#直径を与えるパスの端点からの距離のリストと距離dにある頂点のリストを得る。 -Dlist, FromA = bfs(vmap[max(dist)][0]) -Diameter = max(Dlist) - -#直径を与えるパスのもう片方の端点からBFSを行い、距離 d (0 <= d <= Diameter)の頂点のリストを得る。 -FromB = bfs(FromA[Diameter][0])[1] - -#片方の端点からceil(Diameter/2), floor(Diameter/2)の距離にある頂点を列挙。 -pre_center = FromA[Diameter//2] if Diameter%2 == 0 else FromA[Diameter//2]+FromA[(Diameter+1)//2] -center = list() - -#他方の端点からceil(Diameter/2), floor(Diameter/2)の距離にある頂点を列挙。共通する頂点(中心)を得る。 -for i in FromB[Diameter//2] if Diameter%2 == 0 else FromB[Diameter//2]+FromB[(Diameter+1)//2]: - if i in pre_center: - center.append(i+1) - -for i in sorted(center): - print(i) \ No newline at end of file diff --git a/Tree/FindCenter.py.md b/Tree/FindCenter.py.md new file mode 100644 index 0000000..8c0a2f7 --- /dev/null +++ b/Tree/FindCenter.py.md @@ -0,0 +1,59 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u6728\u306E\u4E2D\u5FC3\u3092\u6C42\u3081\u308B O(N)\n# 1-indexed\u3067\ + \u8868\u3055\u308C\u305F\u6728\u306E\u4E2D\u5FC3\u3068\u306A\u308A\u3046\u308B\ + \u9802\u70B9\u306E\u96C6\u5408\u3092\u6539\u884C\u533A\u5207\u308A\u3067\u51FA\ + \u529B\u3057\u307E\u3059\u3002\nfrom collections import deque\nfrom collections\ + \ import defaultdict\n\ndef bfs(s: int) -> tuple:\n \"\u5E45\u512A\u5148\u63A2\ + \u7D22\u3092\u884C\u3044\u3001\u9802\u70B9 s \u304B\u3089\u306E\u8DDD\u96E2\u3092\ + \u6C42\u3081\u308B\"\n dist = [10000] * N\n dist[s] = 0\n q = deque([s])\n\ + \n vertexmemo = defaultdict(list)\n vertexmemo[0].append(s)\n while q:\n\ + \ v = q.popleft()\n for nxt in g[v]:\n if dist[nxt] ==\ + \ 10000:\n dist[nxt] = dist[v] + 1\n vertexmemo[dist[nxt]].append(nxt)\n\ + \ q.append(nxt)\n \n return dist, vertexmemo\n\nN = int(input())\n\ + \ng = [[] for _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n\ + \ a -= 1\n b -= 1\n g[a].append(b)\n g[b].append(a)\n\ndist, vmap\ + \ = bfs(0)\n\n#\u76F4\u5F84\u3092\u4E0E\u3048\u308B\u30D1\u30B9\u306E\u7AEF\u70B9\ + \u304B\u3089\u306E\u8DDD\u96E2\u306E\u30EA\u30B9\u30C8\u3068\u8DDD\u96E2d\u306B\ + \u3042\u308B\u9802\u70B9\u306E\u30EA\u30B9\u30C8\u3092\u5F97\u308B\u3002\nDlist,\ + \ FromA = bfs(vmap[max(dist)][0])\nDiameter = max(Dlist)\n\n#\u76F4\u5F84\u3092\ + \u4E0E\u3048\u308B\u30D1\u30B9\u306E\u3082\u3046\u7247\u65B9\u306E\u7AEF\u70B9\ + \u304B\u3089BFS\u3092\u884C\u3044\u3001\u8DDD\u96E2 d (0 <= d <= Diameter)\u306E\ + \u9802\u70B9\u306E\u30EA\u30B9\u30C8\u3092\u5F97\u308B\u3002\nFromB = bfs(FromA[Diameter][0])[1]\n\ + \n#\u7247\u65B9\u306E\u7AEF\u70B9\u304B\u3089ceil(Diameter/2), floor(Diameter/2)\u306E\ + \u8DDD\u96E2\u306B\u3042\u308B\u9802\u70B9\u3092\u5217\u6319\u3002\npre_center\ + \ = FromA[Diameter//2] if Diameter%2 == 0 else FromA[Diameter//2]+FromA[(Diameter+1)//2]\n\ + center = list()\n\n#\u4ED6\u65B9\u306E\u7AEF\u70B9\u304B\u3089ceil(Diameter/2),\ + \ floor(Diameter/2)\u306E\u8DDD\u96E2\u306B\u3042\u308B\u9802\u70B9\u3092\u5217\ + \u6319\u3002\u5171\u901A\u3059\u308B\u9802\u70B9(\u4E2D\u5FC3)\u3092\u5F97\u308B\ + \u3002\nfor i in FromB[Diameter//2] if Diameter%2 == 0 else FromB[Diameter//2]+FromB[(Diameter+1)//2]:\n\ + \ if i in pre_center:\n center.append(i+1)\n\nfor i in sorted(center):\n\ + \ print(i)" + dependsOn: [] + isVerificationFile: false + path: Tree/FindCenter.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Tree/FindCenter.py +layout: document +redirect_from: +- /library/Tree/FindCenter.py +- /library/Tree/FindCenter.py.html +title: Tree/FindCenter.py +--- diff --git a/Tree/FindDiameter.py b/Tree/FindDiameter.py deleted file mode 100644 index 164580b..0000000 --- a/Tree/FindDiameter.py +++ /dev/null @@ -1,38 +0,0 @@ -# 木の直径を求める O(N^3) - -from collections import deque - -def bfs(s: int) -> list: - "幅優先探索を行い、頂点 s からの距離を求める" - dist = [10000] * N - dist[s] = 0 - q = deque([s]) - while q: - v = q.popleft() - for nxt in g[v]: - if dist[nxt] == 10000: - dist[nxt] = dist[v] + 1 - q.append(nxt) - - return dist - -N = int(input()) - -g = [[] for _ in range(N)] -for _ in range(N - 1): - a, b = map(int, input().split()) - a -= 1 - b -= 1 - g[a].append(b) - g[b].append(a) - - -dist = bfs(0) - -max_dist = max(dist) -for i in range(N): - if dist[i] == max_dist: - start = i - break - -print(max(bfs(start))) \ No newline at end of file diff --git a/Tree/FindDiameter.py.md b/Tree/FindDiameter.py.md new file mode 100644 index 0000000..d256cfc --- /dev/null +++ b/Tree/FindDiameter.py.md @@ -0,0 +1,41 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u6728\u306E\u76F4\u5F84\u3092\u6C42\u3081\u308B O(N^3)\n\nfrom collections\ + \ import deque\n\ndef bfs(s: int) -> list:\n \"\u5E45\u512A\u5148\u63A2\u7D22\ + \u3092\u884C\u3044\u3001\u9802\u70B9 s \u304B\u3089\u306E\u8DDD\u96E2\u3092\u6C42\ + \u3081\u308B\"\n dist = [10000] * N\n dist[s] = 0\n q = deque([s])\n\ + \ while q:\n v = q.popleft()\n for nxt in g[v]:\n \ + \ if dist[nxt] == 10000:\n dist[nxt] = dist[v] + 1\n \ + \ q.append(nxt)\n \n return dist\n\nN = int(input())\n\ng = [[] for\ + \ _ in range(N)]\nfor _ in range(N - 1):\n a, b = map(int, input().split())\n\ + \ a -= 1\n b -= 1\n g[a].append(b)\n g[b].append(a)\n\n\ndist = bfs(0)\n\ + \nmax_dist = max(dist)\nfor i in range(N):\n if dist[i] == max_dist:\n \ + \ start = i\n break\n\nprint(max(bfs(start)))" + dependsOn: [] + isVerificationFile: false + path: Tree/FindDiameter.py + requiredBy: [] + timestamp: '1970-01-01 00:00:00+00:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Tree/FindDiameter.py +layout: document +redirect_from: +- /library/Tree/FindDiameter.py +- /library/Tree/FindDiameter.py.html +title: Tree/FindDiameter.py +--- diff --git a/Tree/LazySegTree.py b/Tree/LazySegTree.py deleted file mode 100644 index 7a7ef09..0000000 --- a/Tree/LazySegTree.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -〜segfuncの使い方について〜 -update(k, x): k番目の要素をxに更新する -query(l, r): [l, r)(l <= k < r の区間)から値kを取得する -""" -def segfunc(x: int, y: int) -> int: - "ここで求めたい処理を行う, max(x, y) や x ^ y など" - return x ^ y - -""" -〜単位元の一覧について〜 -最小値:float("inf") -最大値:-float("inf") -XOR:0 -区間和:0 -区間積:1 -最大公約数:0 -""" -ide_ele = 0 # 初期値(単位元)の設定 - -class LazySegmentTree: - def __init__(self, init_val, segfunc, ide_ele): - n = len(init_val) - self.segfunc = segfunc - self.ide_ele = ide_ele - self.num = 1 << (n - 1).bit_length() - self.data = [ide_ele] * 2 * self.num - self.lazy = [None] * 2 * self.num - for i in range(n): - self.data[self.num + i] = init_val[i] - for i in range(self.num - 1, 0, -1): - self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1]) - - def gindex(self, l, r): - l += self.num - r += self.num - lm = l >> (l & -l).bit_length() - rm = r >> (r & -r).bit_length() - while l < r: - if l <= lm: - yield l - if r <= rm: - yield r - r >>= 1 - l >>= 1 - while l: - yield l - l >>= 1 - - def propagates(self, *ids): - for i in reversed(ids): - v = self.lazy[i] - if v is None: - continue - self.lazy[2 * i] = v - self.lazy[2 * i + 1] = v - self.data[2 * i] = v - self.data[2 * i + 1] = v - self.lazy[i] = None - - def update(self, l, r, x): - *ids, = self.gindex(l, r) - self.propagates(*ids) - l += self.num - r += self.num - while l < r: - if l & 1: - self.lazy[l] = x - self.data[l] = x - l += 1 - if r & 1: - self.lazy[r - 1] = x - self.data[r - 1] = x - r >>= 1 - l >>= 1 - for i in ids: - self.data[i] = self.segfunc(self.data[2 * i], self.data[2 * i + 1]) - - def query(self, l, r): - *ids, = self.gindex(l, r) - self.propagates(*ids) - res = self.ide_ele - l += self.num - r += self.num - while l < r: - if l & 1: - res = self.segfunc(res, self.data[l]) - l += 1 - if r & 1: - res = self.segfunc(res, self.data[r - 1]) - l >>= 1 - r >>= 1 - return res - -# わからなくなったら典型90問の29を参考にすること \ No newline at end of file diff --git a/Tree/LazySegTree.py.md b/Tree/LazySegTree.py.md new file mode 100644 index 0000000..8309ae7 --- /dev/null +++ b/Tree/LazySegTree.py.md @@ -0,0 +1,70 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "\"\"\"\n\u301Csegfunc\u306E\u4F7F\u3044\u65B9\u306B\u3064\u3044\u3066\u301C\ + \nupdate(k, x): k\u756A\u76EE\u306E\u8981\u7D20\u3092x\u306B\u66F4\u65B0\u3059\ + \u308B\nquery(l, r): [l, r)\uFF08l <= k < r \u306E\u533A\u9593\uFF09\u304B\u3089\ + \u5024k\u3092\u53D6\u5F97\u3059\u308B\n\"\"\"\ndef segfunc(x: int, y: int) ->\ + \ int:\n \"\u3053\u3053\u3067\u6C42\u3081\u305F\u3044\u51E6\u7406\u3092\u884C\ + \u3046, max(x, y) \u3084 x ^ y \u306A\u3069\"\n return x ^ y\n\n\"\"\"\n\u301C\ + \u5358\u4F4D\u5143\u306E\u4E00\u89A7\u306B\u3064\u3044\u3066\u301C\n\u6700\u5C0F\ + \u5024\uFF1Afloat(\"inf\")\n\u6700\u5927\u5024\uFF1A-float(\"inf\")\nXOR\uFF1A\ + 0\n\u533A\u9593\u548C\uFF1A0\n\u533A\u9593\u7A4D\uFF1A1\n\u6700\u5927\u516C\u7D04\ + \u6570\uFF1A0\n\"\"\"\nide_ele = 0 # \u521D\u671F\u5024\uFF08\u5358\u4F4D\u5143\ + \uFF09\u306E\u8A2D\u5B9A\n\nclass 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 l <\ + \ r:\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# \u308F\ + \u304B\u3089\u306A\u304F\u306A\u3063\u305F\u3089\u5178\u578B90\u554F\u306E29\u3092\ + \u53C2\u8003\u306B\u3059\u308B\u3053\u3068" + dependsOn: [] + isVerificationFile: false + path: Tree/LazySegTree.py + requiredBy: [] + timestamp: '2022-02-06 18:58:27+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Tree/LazySegTree.py +layout: document +redirect_from: +- /library/Tree/LazySegTree.py +- /library/Tree/LazySegTree.py.html +title: Tree/LazySegTree.py +--- diff --git a/Tree/RangeMinimamQuery.py b/Tree/RangeMinimamQuery.py deleted file mode 100644 index 1970a26..0000000 --- a/Tree/RangeMinimamQuery.py +++ /dev/null @@ -1,50 +0,0 @@ -""" -〜segfuncの使い方について〜 -update(k, x): k番目の要素をxに更新する -query(l, r): [l, r)(l <= k < r の区間)から値kを取得する -""" - -class SegTree: - def __init__(self, init_val, ide_ele) -> None: - self.ide_ele = ide_ele - self.n = len(init_val) - self.num = 2 ** self.n.bit_length() - self.seg = [self.ide_ele] * 2 * self.num - for i in range(self.n): - self.seg[i + self.num - 1] = init_val[i] - for i in range(self.num - 2, -1, -1): - self.seg[i] = self.segfunc(self.seg[2 * i + 1], self.seg[2 * i + 2]) - - - def segfunc(self, x: int, y: int) -> int: - return min(x, y) - - - def update(self, k: int, x: int) -> None: - k += self.num - 1 - self.seg[k] = self.segfunc(self.seg[k], x) - while k: - k = (k - 1) // 2 - self.seg[k] = self.segfunc(self.seg[k * 2 + 1], self.seg[k * 2 + 2]) - - - def query(self, l: int, r: int): - if r <= l: - return self.ide_ele - l += self.num - 1 - r += self.num - 2 - res = self.ide_ele - while r - l > 1: - if l & 1 == 0: - res = self.segfunc(res, self.seg[l]) - if r & 1 == 1: - res = self.segfunc(res, self.seg[r]) - r -= 1 - l = l // 2 - r = (r - 1) // 2 - if l == r: - res = self.segfunc(res, self.seg[l]) - else: - res = self.segfunc(res, self.segfunc(self.seg[l], self.seg[r])) - - return res \ No newline at end of file diff --git a/Tree/RangeMinimamQuery.py.md b/Tree/RangeMinimamQuery.py.md new file mode 100644 index 0000000..210bf8b --- /dev/null +++ b/Tree/RangeMinimamQuery.py.md @@ -0,0 +1,56 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/yosupo/DataStructure/StaticRMQ.test.py + title: Test/yosupo/DataStructure/StaticRMQ.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "\"\"\"\n\u301Csegfunc\u306E\u4F7F\u3044\u65B9\u306B\u3064\u3044\u3066\u301C\ + \nupdate(k, x): k\u756A\u76EE\u306E\u8981\u7D20\u3092x\u306B\u66F4\u65B0\u3059\ + \u308B\nquery(l, r): [l, r)\uFF08l <= k < r \u306E\u533A\u9593\uFF09\u304B\u3089\ + \u5024k\u3092\u53D6\u5F97\u3059\u308B\n\"\"\"\n\nclass SegTree:\n def __init__(self,\ + \ init_val, ide_ele) -> None:\n self.ide_ele = ide_ele\n self.n\ + \ = len(init_val)\n self.num = 2 ** self.n.bit_length()\n self.seg\ + \ = [self.ide_ele] * 2 * self.num\n for i in range(self.n):\n \ + \ self.seg[i + self.num - 1] = init_val[i]\n for i in range(self.num\ + \ - 2, -1, -1):\n self.seg[i] = self.segfunc(self.seg[2 * i + 1], self.seg[2\ + \ * i + 2])\n\n\n def segfunc(self, x: int, y: int) -> int:\n return\ + \ min(x, y)\n\n\n def update(self, k: int, x: int) -> None:\n k += self.num\ + \ - 1\n self.seg[k] = self.segfunc(self.seg[k], x)\n while k:\n\ + \ k = (k - 1) // 2\n self.seg[k] = self.segfunc(self.seg[k\ + \ * 2 + 1], self.seg[k * 2 + 2])\n\n\n def query(self, l: int, r: int):\n \ + \ if r <= l:\n return self.ide_ele\n l += self.num - 1\n\ + \ r += self.num - 2\n res = self.ide_ele\n while r - l >\ + \ 1:\n if l & 1 == 0:\n res = self.segfunc(res, self.seg[l])\n\ + \ if r & 1 == 1:\n res = self.segfunc(res, self.seg[r])\n\ + \ r -= 1\n l = l // 2\n r = (r - 1) // 2\n\ + \ if l == r:\n res = self.segfunc(res, self.seg[l])\n \ + \ else:\n res = self.segfunc(res, self.segfunc(self.seg[l], self.seg[r]))\n\ + \ \n return res" + dependsOn: [] + isVerificationFile: false + path: Tree/RangeMinimamQuery.py + requiredBy: [] + timestamp: '2022-08-09 15:54:34+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/yosupo/DataStructure/StaticRMQ.test.py +documentation_of: Tree/RangeMinimamQuery.py +layout: document +redirect_from: +- /library/Tree/RangeMinimamQuery.py +- /library/Tree/RangeMinimamQuery.py.html +title: Tree/RangeMinimamQuery.py +--- diff --git a/Tree/SegTree.py b/Tree/SegTree.py deleted file mode 100644 index df0b5e9..0000000 --- a/Tree/SegTree.py +++ /dev/null @@ -1,64 +0,0 @@ -# このセグ木はPythonだとTLEするのでPyPyを推奨します - -""" -〜segfuncの使い方について〜 -update(k, x): k番目の要素をxに更新する -query(l, r): [l, r)(l <= k < r の区間)から値kを取得する -""" -def segfunc(x: int, y: int) -> int: - "ここで求めたい処理を行う, max(x, y) や x ^ y など" - return x ^ y - -""" -〜単位元の一覧について〜 -最小値:float("inf") -最大値:-float("inf") -XOR:0 -区間和:0 -区間積:1 -最大公約数:0 -""" -ide_ele = 0 # 初期値(単位元)の設定 - -class SegTree: - def __init__(self, segfunc, init_val, ide_ele): - self.segfunc = segfunc - self.ide_ele = ide_ele - self.num = 2 ** n.bit_length() - self.seg = [self.ide_ele] * 2 * self.num - for i in range(n): - self.seg[i+self.num - 1] = init_val[i] - for i in range(self.num - 2, -1, -1): - self.seg[i] = self.segfunc(self.seg[2 * i + 1], self.seg[2 * i + 2]) - - def update(self, k, x): - k += self.num - 1 - self.seg[k] = self.segfunc(self.seg[k], x) - while k: - k = (k - 1) // 2 - self.seg[k] = self.segfunc(self.seg[k * 2 + 1], self.seg[k * 2 + 2]) - - def query(self, l, r): - " l は0index, r は1index" - if r <= l: - return self.ide_ele - l += self.num - 1 - r += self.num - 2 - res = self.ide_ele - while r - l > 1: - if l & 1 == 0: - res = self.segfunc(res, self.seg[l]) - if r & 1 == 1: - res = self.segfunc(res, self.seg[r]) - r -= 1 - l = l // 2 - r = (r - 1) // 2 - if l == r: - res = self.segfunc(res, self.seg[l]) - else: - res = self.segfunc(res, self.segfunc(self.seg[l], self.seg[r])) - return res - -n, q = map(int,input().split()) # 配列の長さ・クエリ数 -a = list(map(int,input().split())) # 配列 -seg = SegTree(segfunc, a, ide_ele) # オブジェクトの作成 \ No newline at end of file diff --git a/Tree/SegTree.py.md b/Tree/SegTree.py.md new file mode 100644 index 0000000..e33a155 --- /dev/null +++ b/Tree/SegTree.py.md @@ -0,0 +1,62 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: [] + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':warning:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "# \u3053\u306E\u30BB\u30B0\u6728\u306FPython\u3060\u3068TLE\u3059\u308B\u306E\ + \u3067PyPy\u3092\u63A8\u5968\u3057\u307E\u3059\n\n\"\"\"\n\u301Csegfunc\u306E\u4F7F\ + \u3044\u65B9\u306B\u3064\u3044\u3066\u301C\nupdate(k, x): k\u756A\u76EE\u306E\u8981\ + \u7D20\u3092x\u306B\u66F4\u65B0\u3059\u308B\nquery(l, r): [l, r)\uFF08l <= k <\ + \ r \u306E\u533A\u9593\uFF09\u304B\u3089\u5024k\u3092\u53D6\u5F97\u3059\u308B\n\ + \"\"\"\ndef segfunc(x: int, y: int) -> int:\n \"\u3053\u3053\u3067\u6C42\u3081\ + \u305F\u3044\u51E6\u7406\u3092\u884C\u3046, max(x, y) \u3084 x ^ y \u306A\u3069\ + \"\n return x ^ y\n\n\"\"\"\n\u301C\u5358\u4F4D\u5143\u306E\u4E00\u89A7\u306B\ + \u3064\u3044\u3066\u301C\n\u6700\u5C0F\u5024\uFF1Afloat(\"inf\")\n\u6700\u5927\ + \u5024\uFF1A-float(\"inf\")\nXOR\uFF1A0\n\u533A\u9593\u548C\uFF1A0\n\u533A\u9593\ + \u7A4D\uFF1A1\n\u6700\u5927\u516C\u7D04\u6570\uFF1A0\n\"\"\"\nide_ele = 0 # \u521D\ + \u671F\u5024\uFF08\u5358\u4F4D\u5143\uFF09\u306E\u8A2D\u5B9A\n\nclass SegTree:\n\ + \ def __init__(self, segfunc, init_val, ide_ele):\n self.segfunc = segfunc\n\ + \ self.ide_ele = ide_ele\n self.num = 2 ** n.bit_length()\n \ + \ self.seg = [self.ide_ele] * 2 * self.num\n for i in range(n):\n \ + \ self.seg[i+self.num - 1] = init_val[i]\n for i in range(self.num\ + \ - 2, -1, -1):\n self.seg[i] = self.segfunc(self.seg[2 * i + 1], self.seg[2\ + \ * i + 2])\n\n def update(self, k, x):\n k += self.num - 1\n \ + \ self.seg[k] = self.segfunc(self.seg[k], x)\n while k:\n k\ + \ = (k - 1) // 2\n self.seg[k] = self.segfunc(self.seg[k * 2 + 1],\ + \ self.seg[k * 2 + 2])\n\n def query(self, l, r):\n \" l \u306F0index,\ + \ r \u306F1index\"\n if r <= l:\n return self.ide_ele\n \ + \ l += self.num - 1\n r += self.num - 2\n res = self.ide_ele\n\ + \ while r - l > 1:\n if l & 1 == 0:\n res = self.segfunc(res,\ + \ self.seg[l])\n if r & 1 == 1:\n res = self.segfunc(res,\ + \ self.seg[r])\n r -= 1\n l = l // 2\n r\ + \ = (r - 1) // 2\n if l == r:\n res = self.segfunc(res, self.seg[l])\n\ + \ else:\n res = self.segfunc(res, self.segfunc(self.seg[l],\ + \ self.seg[r]))\n return res\n\nn, q = map(int,input().split()) # \u914D\ + \u5217\u306E\u9577\u3055\u30FB\u30AF\u30A8\u30EA\u6570\na = list(map(int,input().split()))\ + \ # \u914D\u5217\nseg = SegTree(segfunc, a, ide_ele) # \u30AA\u30D6\u30B8\u30A7\ + \u30AF\u30C8\u306E\u4F5C\u6210" + dependsOn: [] + isVerificationFile: false + path: Tree/SegTree.py + requiredBy: [] + timestamp: '2022-02-06 18:58:27+09:00' + verificationStatus: LIBRARY_NO_TESTS + verifiedWith: [] +documentation_of: Tree/SegTree.py +layout: document +redirect_from: +- /library/Tree/SegTree.py +- /library/Tree/SegTree.py.html +title: Tree/SegTree.py +--- diff --git a/Tree/UnionFindTree.py b/Tree/UnionFindTree.py deleted file mode 100644 index bef909d..0000000 --- a/Tree/UnionFindTree.py +++ /dev/null @@ -1,58 +0,0 @@ -class UnionFind: - def __init__(self, n: int) -> None: - self.n = n - self.p = [-1] * n - - - def leader(self, a: int) -> int: - while self.p[a] >= 0: - a = self.p[a] - return a - - - def merge(self, a: int, b: int) -> int: - x = self.leader(a) - y = self.leader(b) - - if x == y: - return x - - if self.p[x] > self.p[y]: - x, y = y, x - - self.p[x] += self.p[y] - self.p[y] = x - - return x - - def same(self, a: int, b: int) -> bool: - return self.leader(a) == self.leader(b) - - def groups(self) -> list: - member = [[] for _ in range(self.n)] - for i in range(self.n): - member[self.leader(i)].append(i) - return member - - def size(self, a: int) -> int: - return -self.p[self.leader(a)] - - -def main() -> None: - N, M = map(int, input().split()) - - UF = UnionFind(N) - - for _ in range(m): - A, B = map(lambda x: int(x) - 1,input().split()) - UF.merge(A, B) - - ans = 0 - for i in range(N): - ans = max(ans, UF.size(i)) - - print(ans) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/Tree/UnionFindTree.py.md b/Tree/UnionFindTree.py.md new file mode 100644 index 0000000..f6b1133 --- /dev/null +++ b/Tree/UnionFindTree.py.md @@ -0,0 +1,54 @@ +--- +data: + _extendedDependsOn: [] + _extendedRequiredBy: [] + _extendedVerifiedWith: + - icon: ':heavy_check_mark:' + path: Test/AOJ/DSL/DSL_1_A.test.py + title: Test/AOJ/DSL/DSL_1_A.test.py + - icon: ':heavy_check_mark:' + path: Test/yosupo/DataStructure/Unionfind.test.py + title: Test/yosupo/DataStructure/Unionfind.test.py + _isVerificationFailed: false + _pathExtension: py + _verificationStatusIcon: ':heavy_check_mark:' + attributes: + links: [] + bundledCode: "Traceback (most recent call last):\n File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py\"\ + , line 71, in _render_source_code_stat\n bundled_code = language.bundle(stat.path,\ + \ basedir=basedir, options={'include_paths': [basedir]}).decode()\n \ + \ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ + \ File \"/opt/hostedtoolcache/Python/3.12.5/x64/lib/python3.12/site-packages/onlinejudge_verify/languages/python.py\"\ + , line 96, in bundle\n raise NotImplementedError\nNotImplementedError\n" + code: "class UnionFind:\n def __init__(self, n: int) -> None:\n self.n\ + \ = n\n self.p = [-1] * n\n\n\n def leader(self, a: int) -> int:\n \ + \ while self.p[a] >= 0:\n a = self.p[a]\n return a\n\n\ + \n def merge(self, a: int, b: int) -> int:\n x = self.leader(a)\n \ + \ y = self.leader(b)\n\n if x == y:\n return x\n\n \ + \ if self.p[x] > self.p[y]:\n x, y = y, x\n\n self.p[x] +=\ + \ self.p[y]\n self.p[y] = x\n\n return x\n\n def same(self, a:\ + \ int, b: int) -> bool:\n return self.leader(a) == self.leader(b)\n\n \ + \ def groups(self) -> list:\n member = [[] for _ in range(self.n)]\n\ + \ for i in range(self.n):\n member[self.leader(i)].append(i)\n\ + \ return member\n\n def size(self, a: int) -> int:\n return -self.p[self.leader(a)]\n\ + \n\ndef main() -> None:\n N, M = map(int, input().split())\n\n UF = UnionFind(N)\n\ + \n for _ in range(m):\n A, B = map(lambda x: int(x) - 1,input().split())\n\ + \ UF.merge(A, B)\n\n ans = 0\n for i in range(N):\n ans =\ + \ max(ans, UF.size(i))\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n \ + \ main()" + dependsOn: [] + isVerificationFile: false + path: Tree/UnionFindTree.py + requiredBy: [] + timestamp: '2024-04-23 12:17:37+09:00' + verificationStatus: LIBRARY_ALL_AC + verifiedWith: + - Test/AOJ/DSL/DSL_1_A.test.py + - Test/yosupo/DataStructure/Unionfind.test.py +documentation_of: Tree/UnionFindTree.py +layout: document +redirect_from: +- /library/Tree/UnionFindTree.py +- /library/Tree/UnionFindTree.py.html +title: Tree/UnionFindTree.py +--- diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..0b6d8f2 --- /dev/null +++ b/_config.yml @@ -0,0 +1,5 @@ +description: This documentation is automatically generated by online-judge-tools/verification-helper +plugins: +- jemoji +- jekyll-redirect-from +theme: jekyll-theme-minimal diff --git a/_includes/document_body.html b/_includes/document_body.html new file mode 100644 index 0000000..20950a8 --- /dev/null +++ b/_includes/document_body.html @@ -0,0 +1,48 @@ +{% if page.data.dependsOn.size != 0 %} +
#include "{{ page.data.path }}"
+ {% if site.github.project_tagline %} + {{ site.github.project_tagline }} + {% else %} + This documentation is automatically generated by online-judge-tools/verification-helper. + {% endif %} +
+{% endif %} + +{% include toppage_body.html %} diff --git a/assets/css/copy-button.css b/assets/css/copy-button.css new file mode 100644 index 0000000..2886a0f --- /dev/null +++ b/assets/css/copy-button.css @@ -0,0 +1,22 @@ +.code-btn { + position: absolute; + border: 1px solid #ccc; + background-color: #fff; + width: 6em; + line-height: 1.2em; + font-size: 0.8em; + cursor: pointer; +} +.code-btn:hover { + color: #fff; + background-color: #267cb9; +} +.code-copy-btn { + top: 0px; + right: 0px; +} +.code-bundle-btn { + top: 0px; + right: 6em; + border-radius: 0 0 0 6px; +} diff --git a/assets/js/copy-button.js b/assets/js/copy-button.js new file mode 100644 index 0000000..475ef47 --- /dev/null +++ b/assets/js/copy-button.js @@ -0,0 +1,60 @@ +window.addEventListener('load', function(){ + const unbundle = function () { + $('#unbundled').each(function(index, element) { + $(element).parent().next().show(); + }); + $('#bundled').each(function(index, element) { + $(element).parent().next().hide(); + }); + $('.code-bundle-btn').each(function(index, element) { + $(element).text("Bundle"); + }); + }; + const bundle = function () { + $('#unbundled').each(function(index, element) { + $(element).parent().next().hide(); + }); + $('#bundled').each(function(index, element) { + $(element).parent().next().show(); + }); + $('.code-bundle-btn').each(function(index, element) { + $(element).text("Unbundle"); + }); + }; + // bundle されたコードは最初は非表示に + let is_bundled = false; + unbundle(); + + // ボタンを実装 + $('pre > code').each(function(index, element) { + $(element).parent().wrap(''); + $(element).parent().parent().append(''); + $(element).parent().parent().append(''); + }); + + $('.code-copy-btn').on('click',function(){ + // テキスト要素を選択&クリップボードにコピー + var textElem = $(this).siblings(':first'); + window.getSelection().selectAllChildren(textElem[0]); + document.execCommand("copy"); + window.getSelection().removeAllRanges(); + + // コピー完了した後の処理 + // トースト通知とかすると親切かも... + $(this).showBalloon(); + const this_ = this; + setTimeout(function() { + $(this_).hideBalloon(); + }, 300); + }); + + $('.code-bundle-btn').on('click', function(){ + // bundle / unbundle の切り替え + if (is_bundled) { + unbundle(); + } else { + bundle(); + } + is_bundled = ! is_bundled; + }); +}); diff --git a/index.md b/index.md new file mode 100644 index 0000000..e01bb39 --- /dev/null +++ b/index.md @@ -0,0 +1,461 @@ +--- +data: + libraryCategories: + - name: DP + pages: + - icon: ':warning:' + path: DP/LongestCommonSubsequence.py + title: DP/LongestCommonSubsequence.py + - icon: ':warning:' + path: DP/LongestIncreasingSubsequence.py + title: DP/LongestIncreasingSubsequence.py + - icon: ':warning:' + path: DP/SlideMaxAlgorithm.py + title: DP/SlideMaxAlgorithm.py + - icon: ':warning:' + path: DP/SlideMinAlgorithm.py + title: DP/SlideMinAlgorithm.py + - name: Geometry + pages: + - icon: ':warning:' + path: Geometry/RotateLeft.py + title: Geometry/RotateLeft.py + - icon: ':warning:' + path: Geometry/RotateReverse.py + title: Geometry/RotateReverse.py + - icon: ':warning:' + path: Geometry/RotateRight.py + title: Geometry/RotateRight.py + - icon: ':warning:' + path: Geometry/RotateTranspose.py + title: Geometry/RotateTranspose.py + - icon: ':warning:' + path: Geometry/SharedPoint.py + title: Geometry/SharedPoint.py + - name: Graph + pages: + - icon: ':warning:' + path: Graph/BellmanFord.py + title: Graph/BellmanFord.py + - icon: ':warning:' + path: Graph/Dijkstra.py + title: Graph/Dijkstra.py + - icon: ':warning:' + path: Graph/EulerTour.py + title: Graph/EulerTour.py + - icon: ':heavy_check_mark:' + path: Graph/Kruskal.py + title: Graph/Kruskal.py + - icon: ':warning:' + path: Graph/LowestCommonAncestor.py + title: Graph/LowestCommonAncestor.py + - icon: ':warning:' + path: Graph/Prim.py + title: Graph/Prim.py + - icon: ':warning:' + path: Graph/StronglyConnectedComponent.py + title: Graph/StronglyConnectedComponent.py + - icon: ':warning:' + path: Graph/TopologicalSort.py + title: Graph/TopologicalSort.py + - icon: ':warning:' + path: Graph/warshall_floyd.py + title: Graph/warshall_floyd.py + - name: Math + pages: + - icon: ':warning:' + path: Math/BinaryToDecimal.py + title: Math/BinaryToDecimal.py + - icon: ':warning:' + path: Math/Combination.py + title: Math/Combination.py + - icon: ':warning:' + path: Math/CumulativeSum.py + title: Math/CumulativeSum.py + - icon: ':warning:' + path: Math/DecimalToBinary.py + title: Math/DecimalToBinary.py + - icon: ':heavy_check_mark:' + path: Math/Dice.py + title: Math/Dice.py + - icon: ':heavy_check_mark:' + path: Math/DigitSum_int.py + title: Math/DigitSum_int.py + - icon: ':warning:' + path: Math/DigitSum_str.py + title: Math/DigitSum_str.py + - icon: ':heavy_check_mark:' + path: Math/Divisor.py + title: Math/Divisor.py + - icon: ':warning:' + path: Math/ExtGCD.py + title: Math/ExtGCD.py + - icon: ':heavy_check_mark:' + path: Math/Factorization.py + title: Math/Factorization.py + - icon: ':warning:' + path: Math/FromFloatToInt.py + title: Math/FromFloatToInt.py + - icon: ':warning:' + path: Math/ManhattanDistanceSearch.py + title: Math/ManhattanDistanceSearch.py + - icon: ':warning:' + path: Math/MatrixPow.py + title: Math/MatrixPow.py + - icon: ':heavy_check_mark:' + path: Math/MaxCumulativeSum.py + title: Math/MaxCumulativeSum.py + - icon: ':warning:' + path: Math/NFactorizarition.py + title: Math/NFactorizarition.py + - icon: ':heavy_check_mark:' + path: Math/PrimaryCheck.py + title: Math/PrimaryCheck.py + - icon: ':heavy_check_mark:' + path: Math/SieveOfEratosthenes.py + title: Math/SieveOfEratosthenes.py + - icon: ':warning:' + path: Math/SortedMultiset.py + title: Math/SortedMultiset.py + - icon: ':warning:' + path: Math/SortedSet.py + title: Math/SortedSet.py + - icon: ':warning:' + path: Math/XorToN.py + title: Math/XorToN.py + - icon: ':warning:' + path: Math/doubling.py + title: Math/doubling.py + - icon: ':warning:' + path: Math/nCk.py + title: Math/nCk.py + - icon: ':warning:' + path: Math/nCkFactorization.py + title: Math/nCkFactorization.py + - name: Other + pages: + - icon: ':warning:' + path: Other/debug.py + title: Other/debug.py + - name: Search + pages: + - icon: ':warning:' + path: Search/BinarySearch.py + title: Search/BinarySearch.py + - icon: ':warning:' + path: Search/BitSearch.py + title: Search/BitSearch.py + - icon: ':warning:' + path: Search/BreadthFirstSearch_graph.py + title: Search/BreadthFirstSearch_graph.py + - icon: ':warning:' + path: Search/BreadthFirstSearch_grid.py + title: Search/BreadthFirstSearch_grid.py + - name: String + pages: + - icon: ':warning:' + path: String/BoyerMoore.py + title: String/BoyerMoore.py + - icon: ':warning:' + path: String/CoordinateCompression.py + title: String/CoordinateCompression.py + - icon: ':warning:' + path: String/RunLengthEncoding.py + title: String/RunLengthEncoding.py + - name: Template + pages: + - icon: ':warning:' + path: Template/Template.py + title: Template/Template.py + - icon: ':warning:' + path: Template/VerifyHelperTemplate.py + title: Template/VerifyHelperTemplate.py + - name: Test/yosupo/DataStructure + pages: + - icon: ':warning:' + path: Test/yosupo/DataStructure/AssociativeArray.py + title: Test/yosupo/DataStructure/AssociativeArray.py + - name: Tree + pages: + - icon: ':warning:' + path: Tree/BinaryIndexedTree.py + title: Tree/BinaryIndexedTree.py + - icon: ':warning:' + path: Tree/FindCenter.py + title: Tree/FindCenter.py + - icon: ':warning:' + path: Tree/FindDiameter.py + title: Tree/FindDiameter.py + - icon: ':warning:' + path: Tree/LazySegTree.py + title: Tree/LazySegTree.py + - icon: ':heavy_check_mark:' + path: Tree/RangeMinimamQuery.py + title: Tree/RangeMinimamQuery.py + - icon: ':warning:' + path: Tree/SegTree.py + title: Tree/SegTree.py + - icon: ':heavy_check_mark:' + path: Tree/UnionFindTree.py + title: Tree/UnionFindTree.py + verificationCategories: + - name: Test/AOJ/ALDS1 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/ALDS1/ALDS1_13_A.test.py + title: Test/AOJ/ALDS1/ALDS1_13_A.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ALDS1/ALDS1_1_B.test.py + title: Test/AOJ/ALDS1/ALDS1_1_B.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ALDS1/ALDS1_1_C.test.py + title: Test/AOJ/ALDS1/ALDS1_1_C.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ALDS1/ALDS1_4_B.test.py + title: Test/AOJ/ALDS1/ALDS1_4_B.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ALDS1/ALDS1_5_D.test.py + title: Test/AOJ/ALDS1/ALDS1_5_D.test.py + - name: Test/AOJ/DSL + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/DSL/DSL_1_A.test.py + title: Test/AOJ/DSL/DSL_1_A.test.py + - name: Test/AOJ/GRL + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/GRL/GRL_1_A.test.py + title: Test/AOJ/GRL/GRL_1_A.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/GRL/GRL_1_B.test.py + title: Test/AOJ/GRL/GRL_1_B.test.py + - name: Test/AOJ/ITP1 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ALDS1_10_C.test.py + title: Test/AOJ/ITP1/ALDS1_10_C.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ALDS1_10_D.test.py + title: Test/AOJ/ITP1/ALDS1_10_D.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_11_A.test.py + title: Test/AOJ/ITP1/ITP1_11_A.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_11_B.test.py + title: Test/AOJ/ITP1/ITP1_11_B.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_11_C.test.py + title: Test/AOJ/ITP1/ITP1_11_C.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_11_D.test.py + title: Test/AOJ/ITP1/ITP1_11_D.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_2_A.test.py + title: Test/AOJ/ITP1/ITP1_2_A.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_3_D.test.py + title: Test/AOJ/ITP1/ITP1_3_D.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/ITP1/ITP1_8_B.test.py + title: Test/AOJ/ITP1/ITP1_8_B.test.py + - name: Test/AOJ/Volume0 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume0/0000.test.py + title: Test/AOJ/Volume0/0000.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume0/0001.test.py + title: Test/AOJ/Volume0/0001.test.py + - icon: ':x:' + path: Test/AOJ/Volume0/0002.test.py + title: Test/AOJ/Volume0/0002.test.py + - icon: ':x:' + path: Test/AOJ/Volume0/0003.test.py + title: Test/AOJ/Volume0/0003.test.py + - icon: ':x:' + path: Test/AOJ/Volume0/0004.test.py + title: Test/AOJ/Volume0/0004.test.py + - name: Test/AOJ/Volume10 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume10/1000.test.py + title: Test/AOJ/Volume10/1000.test.py + - name: Test/AOJ/Volume11 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume11/1147.test.py + title: Test/AOJ/Volume11/1147.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume11/1153.test.py + title: Test/AOJ/Volume11/1153.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume11/1172.test.py + title: Test/AOJ/Volume11/1172.test.py + - name: Test/AOJ/Volume16 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume16/1608.test.py + title: Test/AOJ/Volume16/1608.test.py + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume16/1640.test.py + title: Test/AOJ/Volume16/1640.test.py + - name: Test/AOJ/Volume21 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume21/2197.test.py + title: Test/AOJ/Volume21/2197.test.py + - name: Test/AOJ/Volume29 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume29/2944.test.py + title: Test/AOJ/Volume29/2944.test.py + - name: Test/AOJ/Volume32 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume32/3202.test.py + title: Test/AOJ/Volume32/3202.test.py + - name: Test/AOJ/Volume5 + pages: + - icon: ':heavy_check_mark:' + path: Test/AOJ/Volume5/0516.test.py + title: Test/AOJ/Volume5/0516.test.py + - name: Test/yosupo/DataStructure + pages: + - icon: ':heavy_check_mark:' + path: Test/yosupo/DataStructure/StaticRMQ.test.py + title: Test/yosupo/DataStructure/StaticRMQ.test.py + - icon: ':heavy_check_mark:' + path: Test/yosupo/DataStructure/Unionfind.test.py + title: Test/yosupo/DataStructure/Unionfind.test.py + - name: Test/yosupo/Sample + pages: + - icon: ':heavy_check_mark:' + path: Test/yosupo/Sample/A+B.test.py + title: Test/yosupo/Sample/A+B.test.py + - icon: ':heavy_check_mark:' + path: Test/yosupo/Sample/ManyA+B.test.py + title: Test/yosupo/Sample/ManyA+B.test.py + - name: Test/yukicoder + pages: + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0001.test.py + title: Test/yukicoder/0001.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0002.test.py + title: Test/yukicoder/0002.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0003.test.py + title: Test/yukicoder/0003.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0004.test.py + title: Test/yukicoder/0004.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0005.test.py + title: Test/yukicoder/0005.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0007.test.py + title: Test/yukicoder/0007.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0008.test.py + title: Test/yukicoder/0008.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0009.test.py + title: Test/yukicoder/0009.test.py + - icon: ':x:' + path: Test/yukicoder/0015.test.py + title: Test/yukicoder/0015.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0044.test.py + title: Test/yukicoder/0044.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0053.test.py + title: Test/yukicoder/0053.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0064.test.py + title: Test/yukicoder/0064.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0167.test.py + title: Test/yukicoder/0167.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0182.test.py + title: Test/yukicoder/0182.test.py + - icon: ':x:' + path: Test/yukicoder/0204.test.py + title: Test/yukicoder/0204.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0208.test.py + title: Test/yukicoder/0208.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0244.test.py + title: Test/yukicoder/0244.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0314.test.py + title: Test/yukicoder/0314.test.py + - icon: ':x:' + path: Test/yukicoder/0451.test.py + title: Test/yukicoder/0451.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0677.test.py + title: Test/yukicoder/0677.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0697.test.py + title: Test/yukicoder/0697.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0713.test.py + title: Test/yukicoder/0713.test.py + - icon: ':x:' + path: Test/yukicoder/0786.test.py + title: Test/yukicoder/0786.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/0847.test.py + title: Test/yukicoder/0847.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1003.test.py + title: Test/yukicoder/1003.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1155.test.py + title: Test/yukicoder/1155.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1367.test.py + title: Test/yukicoder/1367.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1454.test.py + title: Test/yukicoder/1454.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1639.test.py + title: Test/yukicoder/1639.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1737.test.py + title: Test/yukicoder/1737.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1749.test.py + title: Test/yukicoder/1749.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/1808.test.py + title: Test/yukicoder/1808.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2034.test.py + title: Test/yukicoder/2034.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2093.test.py + title: Test/yukicoder/2093.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2371.test.py + title: Test/yukicoder/2371.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2373.test.py + title: Test/yukicoder/2373.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2557.test.py + title: Test/yukicoder/2557.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2558.test.py + title: Test/yukicoder/2558.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2559.test.py + title: Test/yukicoder/2559.test.py + - icon: ':heavy_check_mark:' + path: Test/yukicoder/2570.test.py + title: Test/yukicoder/2570.test.py +layout: toppage +---