aboutsummaryrefslogtreecommitdiffhomepage
path: root/archive/q/base32/a/96/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'archive/q/base32/a/96/index.html')
-rw-r--r--archive/q/base32/a/96/index.html115
1 files changed, 115 insertions, 0 deletions
diff --git a/archive/q/base32/a/96/index.html b/archive/q/base32/a/96/index.html
new file mode 100644
index 0000000..377e4bc
--- /dev/null
+++ b/archive/q/base32/a/96/index.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>問題 #2 - 回答 #96 | Albatross.PHP</title>
+ <link rel="stylesheet" href="../../../../assets/index.css">
+ <link rel="icon" type="image/svg+xml" href="../../../../assets/favicon.svg">
+ <script type="module" src="../../../../assets/index.js"></script>
+ </head>
+ <body>
+ <header class="container">
+ <nav class="navbar">
+ <a class="navbar-brand" href="../../../../index.html">Albatross.PHP</a>
+ </nav>
+ </header>
+ <main class="container mt-5">
+ <h1 class="mb-4">問題 #2 - 回答 #96</h1>
+ <nav>
+ <ol class="breadcrumb">
+ <li class="breadcrumb-item"><a href="../../../../index.html">問題一覧</a></li>
+ <li class="breadcrumb-item"><a href="../../index.html">Base32</a></li>
+ <li class="breadcrumb-item"><a href="../index.html">回答一覧</a></li>
+ <li class="breadcrumb-item active">#96</li>
+ </ol>
+ </nav>
+
+ <h2>Base32</h2>
+ <p>
+ RFC 4648 で定義された Base32 エンコーディングを実装してください。
+標準入力から与えられる各行に対し、Base32 エンコードをおこなった文字列を標準出力へ改行区切りで出力してください。
+なお、アルファベットの出力には大文字を用いてください。
+ </p>
+ <h2>回答 #96</h2>
+ <p>
+ basi が 2024-03-09 00:40:11 に投稿
+ </p>
+ <h2>コード</h2>
+ <p>
+ 227 byte
+ </p>
+ <pre><code class="hljs language-php">while($l=fgets(STDIN)){foreach(str_split(trim($l))as$c)@$b.=sprintf(&#039;%08b&#039;,ord($c));$p=strlen($b)%40;foreach(str_split($b,5)as$c)echo(join(range(&#039;A&#039;,&#039;Z&#039;)).&#039;234567&#039;)[bindec(str_pad($c,5,&#039;0&#039;))];echo str_repeat(&#039;=&#039;,6-$p%8%6),&#039;
+&#039;;}</code></pre>
+ <h2>実行結果</h2>
+ <div class="js-phper-token">
+ </div>
+ <div class="mt-3">
+ ステータス: <span class="js-aggregated-execution-status" data-answer-id="352">失敗</span>
+ </div>
+ <div class="mt-3">
+ <h3>テストケース 1</h3>
+ <div>
+ ステータス: <span class="js-testcase-execution-status" data-testcase-execution-id="781">不正解</span>
+ </div>
+ <h4>標準出力</h4>
+ <pre><code class="js-testcase-execution-stdout hljs language-plaintext" data-testcase-execution-id="781">NBXWOZI======
+NBXWOZLQNF4W6======
+NBXWOZLQNF4W6ZTVM5QQ======
+
+</code></pre>
+ <h4>標準エラー出力</h4>
+ <pre><code class="js-testcase-execution-stderr hljs language-plaintext" data-testcase-execution-id="781">
+</code></pre>
+ <h3>テストケース 2</h3>
+ <div>
+ ステータス: <span class="js-testcase-execution-status" data-testcase-execution-id="782">不正解</span>
+ </div>
+ <h4>標準出力</h4>
+ <pre><code class="js-testcase-execution-stdout hljs language-plaintext" data-testcase-execution-id="782">4OAYNY4BRPRYFCXDQGX6HAMS======
+4OAYNY4BRPRYFCXDQGX6HAMS4OA2VY4BRTRYFCPDQGDOHAMX======
+4OAYNY4BRPRYFCXDQGX6HAMS4OA2VY4BRTRYFCPDQGDOHAMX4OBI7Y4BTHRYFCPDQKBOHANB======
+
+</code></pre>
+ <h4>標準エラー出力</h4>
+ <pre><code class="js-testcase-execution-stderr hljs language-plaintext" data-testcase-execution-id="782">
+</code></pre>
+ <h3>テストケース 3</h3>
+ <div>
+ ステータス: <span class="js-testcase-execution-status" data-testcase-execution-id="783">不正解</span>
+ </div>
+ <h4>標準出力</h4>
+ <pre><code class="js-testcase-execution-stdout hljs language-plaintext" data-testcase-execution-id="783">GEZDGNBVGY3Q======
+GEZDGNBVGY3TCMQ======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMA======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44A======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44DCMRT======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44DCMRTGEZDGNBV======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44DCMRTGEZDGNBVGEZDGNBVGY3TQOI======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44DCMRTGEZDGNBVGEZDGNBVGY3TQOJRGIZTI======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44DCMRTGEZDGNBVGEZDGNBVGY3TQOJRGIZTIMI======
+GEZDGNBVGY3TCMRRGIZTINJWG44DSMBRGIZTINJWG44DCMRTGEZDGNBVGEZDGNBVGY3TQOJRGIZTIMJRGIZTINJW======
+
+</code></pre>
+ <h4>標準エラー出力</h4>
+ <pre><code class="js-testcase-execution-stderr hljs language-plaintext" data-testcase-execution-id="783">
+</code></pre>
+ <h3>テストケース 4</h3>
+ <div>
+ ステータス: <span class="js-testcase-execution-status" data-testcase-execution-id="784">不正解</span>
+ </div>
+ <h4>標準出力</h4>
+ <pre><code class="js-testcase-execution-stdout hljs language-plaintext" data-testcase-execution-id="784">MEQGEIDD======
+MEQGEIDD4OAYFY4BQQQOHAMGEDRYDCBA4OAYU======
+
+</code></pre>
+ <h4>標準エラー出力</h4>
+ <pre><code class="js-testcase-execution-stderr hljs language-plaintext" data-testcase-execution-id="784">
+</code></pre>
+ </div>
+ <script type="module" src="../../../../assets/loading.js"></script>
+ </main>
+ <footer class="container text-center mt-5 mb-4">
+ Albatross.PHP - PHPerKaigi 2024
+ </footer>
+ </body>
+</html>