-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add general answer 35-46 & fix judge * update update * add news
- Loading branch information
1 parent
9cea7bc
commit 78fe489
Showing
6 changed files
with
122 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,8 @@ | |
|
||
|
||
<title>シェル芸オンラインジャッジ / SHELLGEI ONLINE JUDGE</title> | ||
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1092"> | ||
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1092"> | ||
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1095"> | ||
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1095"> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:[email protected]&display=swap" rel="stylesheet"> | ||
|
@@ -55,11 +55,12 @@ <h1 class="heading-028" data-label="SHELLGEI ONLINE JUDGE">Shell one-liner playg | |
<h2>INFORMATION</h2> | ||
<h3>LAST UPDATED</h3> | ||
<ul> | ||
<li>- 2024/11/24</li> | ||
<li>- 2024/11/28</li> | ||
</ul> | ||
|
||
<h3>NEWS</h3> | ||
<ul> | ||
<li>- 2024/11/28: Added Example Answer</li> | ||
<li>- 2024/09/06: Added Image Problems</li> | ||
<li>- 2024/05/03: 1st Anniversary of SHELLGEI ONLINE JUDGE</li> | ||
<li>- 2024/04/24: Added Exercise Problems</li> | ||
|
@@ -122,6 +123,8 @@ <h3>How to play</h3> | |
<details> | ||
<summary>2024</summary> | ||
<ul> | ||
<li>- 11/28: news追加</li> | ||
<li>- 11/27: GENERALの回答例を追加、正誤判定を修正</li> | ||
<li>- 11/24: concatとcowsayを削除</li> | ||
<li>- 11/23: ドキュメントのメンテナンス</li> | ||
<li>- 11/22: ドキュメントのメンテナンス</li> | ||
|
@@ -206,7 +209,7 @@ <h3>GitHub</h3> | |
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions">GitHub - Discussions</a></li> | ||
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/issues">GitHub - Issues</a></li> | ||
</ul> | ||
<h3>Others</h3> | ||
<h3>Author</h3> | ||
<ul> | ||
<li>- GitHub : <a href="https://github.com/YusukeKato">YusukeKato</a></li> | ||
<li>- Blog : <a href="https://yusukekato.jp/">yusukekato.jp</a></li> | ||
|
@@ -318,6 +321,33 @@ <h3>Answer</h3> | |
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print substr($1,1,1), length($1)}'</code></pre></div> | ||
<p>34</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | factor | xargs -n1 | awk 'NR>1' | xargs | awk '{for(i=1;i<=NF/5;i++){print $i}}' | awk 'BEGIN{a=1}{a=a*$1}END{print a}'</code></pre></div> | ||
<p>35</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1,$1}' | xargs -n1</code></pre></div> | ||
<p>36</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i<s$1;i++){print $1}}'</code></pre></div> | ||
<p>37</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/[^0-9]/ /g' | awk '{for(i=1;i<=NF;i++){print $i}}'</code></pre></div> | ||
<p>38</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{if($1%$2==0){print "Yes"}else{print "No"}}'</code></pre></div> | ||
<p>39</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | uniq -u | tr -d '\n'</code></pre></div> | ||
<p>40</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | sort | uniq -c | awk 'NR>1{print $2,$1}'</code></pre></div> | ||
</details> | ||
<details> | ||
<summary>41 - 50</summary> | ||
<p>41</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3;print $0}NR==2{x=a-$1-$3;print $1,x,$3}NR==3{print $0}'</code></pre></div> | ||
<p>42</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3+$4+$5}NR==3{x=a-$1-$2-$4-$5;print $1,$2,x,$4,$5}NR!=3{print $0}' | sed '3 s/\( [0-9] \)/ \1/g;3 s/\( [0-9]$\)/ \1/g'</code></pre></div> | ||
<p>43</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1".png",$1".jpg"}'</code></pre></div> | ||
<p>44</p> | ||
<div class="codeClass"><pre><code class="mono-font2">find ShellGeiData/vol.68 -type f | xargs -I@ grep entrepreneurial -rl @ | awk -F'/' '{print $NF}'</code></pre></div> | ||
<p>45</p> | ||
<div class="codeClass"><pre><code class="mono-font2">echo | awk '{for(i=0;i<6;i++){for(j=0;j<6;j++){if(i>=3&&j<3){printf("3")}else if(i<3&&j<3){printf("2")}else if(i<3&&j>=3){printf("1")}else if(i>=3&&j>=3){printf("4")}};printf("\n")}}'</code></pre></div> | ||
<p>46</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i<$1;i++){for(j=0;j<$1;j++){if(i==j){printf("1")}else{printf("0")}}printf("\n")}}'</code></pre></div> | ||
</details> | ||
</details> | ||
|
||
|
@@ -678,7 +708,7 @@ <h3>Executed Shell-gei</h3> | |
<script> | ||
var is_jp = false; | ||
</script> | ||
<script src="https://shellgei-online-judge.com/index.js?version=1092"></script> | ||
<script src="https://shellgei-online-judge.com/index.js?version=1095"></script> | ||
</div> <!-- alldiv --> | ||
<h1 class="heading-028-2" data-label="">GitHub - <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions" class="white-link">SHELLGEI ONLINE JUDGE Discussions</a><br>© 2023 YusukeKato All rights reserved.</h1> | ||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,8 @@ | |
|
||
|
||
<title>シェル芸オンラインジャッジ / SHELLGEI ONLINE JUDGE</title> | ||
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1092"> | ||
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1092"> | ||
<link rel="icon" href="https://shellgei-online-judge.com/favicon.jpg?version=1095"> | ||
<link rel="stylesheet" href="https://shellgei-online-judge.com/style.css?version=1095"> | ||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:[email protected]&display=swap" rel="stylesheet"> | ||
|
@@ -55,11 +55,12 @@ <h1 class="heading-028" data-label="SHELLGEI ONLINE JUDGE">シェル・ワンラ | |
<h2>概要</h2> | ||
<h3>最終更新日</h3> | ||
<ul> | ||
<li>- 2024/11/24</li> | ||
<li>- 2024/11/28</li> | ||
</ul> | ||
|
||
<h3>お知らせ</h3> | ||
<ul> | ||
<li>- 2024/11/28: 回答例を追加</li> | ||
<li>- 2024/09/06: 画像問題を追加</li> | ||
<li>- 2024/05/03: シェル芸オンラインジャッジ一周年</li> | ||
<li>- 2024/04/24: 練習問題を追加</li> | ||
|
@@ -75,9 +76,9 @@ <h3>情報</h3> | |
<summary>このサイトとシェル芸について</summary> | ||
<h3>シェル芸オンラインジャッジとは</h3> | ||
<ul> | ||
<li>- このサイトはシェル芸非公式です。</li> | ||
<li>- シェル芸で問題を解いて遊べます。</li> | ||
<li>- 出力結果の正誤判定も自動で行われます。</li> | ||
<li>- このサイトはシェル芸非公式です。</li> | ||
</ul> | ||
<h3>シェル芸とは</h3> | ||
<ul> | ||
|
@@ -88,7 +89,7 @@ <h3>シェル芸の例</h3> | |
<p>Example 1: Output random String</p> | ||
<div class="codeClass"><pre><code class="mono-font2">head -c 65536 /dev/urandom | tr -dc a-zA-Z0-9 | cut -c -16</code></pre></div> | ||
<p>Example 2: Delete all .jpg files</p> | ||
<div class="codeClass"><pre><code class="mono-font2">find . | grep .jpg$ | xargs -I@ rm @</code></pre></div> | ||
<div class="codeClass"><pre><code class="mono-font2">find /tmp | grep .jpg$ | xargs -I@ rm @</code></pre></div> | ||
<h3>Shellgei Online Judge Repository</h3> | ||
<ul> | ||
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge">GitHub - ShellgeiOnlineJudge</a></li> | ||
|
@@ -122,6 +123,8 @@ <h3>遊び方</h3> | |
<details> | ||
<summary>2024</summary> | ||
<ul> | ||
<li>- 11/28: news追加</li> | ||
<li>- 11/27: GENERALの回答例を追加、正誤判定を修正</li> | ||
<li>- 11/24: concatとcowsayを削除</li> | ||
<li>- 11/23: ドキュメントのメンテナンス</li> | ||
<li>- 11/22: ドキュメントのメンテナンス</li> | ||
|
@@ -206,7 +209,7 @@ <h3>GitHub</h3> | |
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions">GitHub - Discussions</a></li> | ||
<li>- <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/issues">GitHub - Issues</a></li> | ||
</ul> | ||
<h3>その他</h3> | ||
<h3>Author</h3> | ||
<ul> | ||
<li>- GitHub : <a href="https://github.com/YusukeKato">YusukeKato</a></li> | ||
<li>- Blog : <a href="https://yusukekato.jp/">yusukekato.jp</a></li> | ||
|
@@ -318,6 +321,33 @@ <h3>回答例</h3> | |
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print substr($1,1,1), length($1)}'</code></pre></div> | ||
<p>34</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | factor | xargs -n1 | awk 'NR>1' | xargs | awk '{for(i=1;i<=NF/5;i++){print $i}}' | awk 'BEGIN{a=1}{a=a*$1}END{print a}'</code></pre></div> | ||
<p>35</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1,$1}' | xargs -n1</code></pre></div> | ||
<p>36</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i<s$1;i++){print $1}}'</code></pre></div> | ||
<p>37</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/[^0-9]/ /g' | awk '{for(i=1;i<=NF;i++){print $i}}'</code></pre></div> | ||
<p>38</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{if($1%$2==0){print "Yes"}else{print "No"}}'</code></pre></div> | ||
<p>39</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | uniq -u | tr -d '\n'</code></pre></div> | ||
<p>40</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | sed 's/\([a-z]\)/\1\n/g' | sort | uniq -c | awk 'NR>1{print $2,$1}'</code></pre></div> | ||
</details> | ||
<details> | ||
<summary>41 - 50</summary> | ||
<p>41</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3;print $0}NR==2{x=a-$1-$3;print $1,x,$3}NR==3{print $0}'</code></pre></div> | ||
<p>42</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk 'NR==1{a=$1+$2+$3+$4+$5}NR==3{x=a-$1-$2-$4-$5;print $1,$2,x,$4,$5}NR!=3{print $0}' | sed '3 s/\( [0-9] \)/ \1/g;3 s/\( [0-9]$\)/ \1/g'</code></pre></div> | ||
<p>43</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{print $1".png",$1".jpg"}'</code></pre></div> | ||
<p>44</p> | ||
<div class="codeClass"><pre><code class="mono-font2">find ShellGeiData/vol.68 -type f | xargs -I@ grep entrepreneurial -rl @ | awk -F'/' '{print $NF}'</code></pre></div> | ||
<p>45</p> | ||
<div class="codeClass"><pre><code class="mono-font2">echo | awk '{for(i=0;i<6;i++){for(j=0;j<6;j++){if(i>=3&&j<3){printf("3")}else if(i<3&&j<3){printf("2")}else if(i<3&&j>=3){printf("1")}else if(i>=3&&j>=3){printf("4")}};printf("\n")}}'</code></pre></div> | ||
<p>46</p> | ||
<div class="codeClass"><pre><code class="mono-font2">cat input.txt | awk '{for(i=0;i<$1;i++){for(j=0;j<$1;j++){if(i==j){printf("1")}else{printf("0")}}printf("\n")}}'</code></pre></div> | ||
</details> | ||
</details> | ||
|
||
|
@@ -678,7 +708,7 @@ <h3>実行したシェル芸</h3> | |
<script> | ||
var is_jp = true; | ||
</script> | ||
<script src="https://shellgei-online-judge.com/index.js?version=1092"></script> | ||
<script src="https://shellgei-online-judge.com/index.js?version=1095"></script> | ||
</div> <!-- alldiv --> | ||
<h1 class="heading-028-2" data-label="">GitHub - <a href="https://github.com/YusukeKato/ShellgeiOnlineJudge/discussions" class="white-link">SHELLGEI ONLINE JUDGE Discussions</a><br>© 2023 YusukeKato All rights reserved.</h1> | ||
</body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.