塩弟
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    TSG-KMC esolang 2021/03 Blue === ルール https://esolang-codegolf.hiromi-mi.jp/contests/7/rule 概要 --- 青チームの情報共有 アルゴリズム --- - 2進数にしてa&b|b&c|c&a - これは10進数でもよいです(1,10,100のbitが上手いこと分かれているので) - スタック型の言語ではa&b|c&(a|b)にすると便利 - 文字列のまま&(Perl) - これは文字列結合で(a+(b+c)&(b+c)+a)にできるのがよさそうです - 2進数にしてa+b+c>(a|b|c) - これは10進数でもよいです - 1-(a|b|c)//(a+b+c) - /1...(....)?1/ - 3行をa,b,cとしたとき、a+b+c+aが得られれば/1...1/でよい - a+b+c in [111,110,101,11] (テストケース制約より) - 4進数以上 - (a+b+c)/2 in [55,50,5] - (a+b+c)%24 in [5,11,14,15] などの派生もありそう - (a+b+c)=~/2|3/ 数値として加算して2か3を探す - 8(16,4)進数として3つを足して146(546,42)とのbit&を取る - 1パターンの入力を ``` def ghi jkl ``` としたとき、`s=d*g*j+e*h*k+f*i*l`を9で割りきれるかどうか(ただし各値はアスキーコード)。 '0'=48=3×16, '1'=49=3×16+1であることから。同様に256で割れるかを調べてもよい。(値が自動的に256で割った余りになるBrainfuckなどだと有利?) 原理的にはa+b+c in [111,110,101,11]と同様。たとえばa+b+c=110のとき、`s=48^2*49+48^2*49+48^3=336384`となり、これは9で割り切れる。 - 転置とソートを使う (Stuck) - 入力を `[[d,e,f],[g,h,i],[j,k,l]]` として受け取り、これを転置して各要素をソートし2番目を取り出す。取り出した要素をもう一度ソートして3番目を取り出す。 - zipして各列のmedianのmaxとも捉えられる コード --- C 69B ```c= main(a,b,c){for(;~scanf("%x%x%x",&a,&b,&c);)puts(a+b+c&546?"1":"0");} ``` C 64B(131586は''で書く) ```c= d,x;main(i){for(;gets(&d);x=i++%3?x:puts(x&131586?"1":"0"))x+=d;} ``` Python3 67B ```python= for s in zip(*[open(0)]*3):a,b,c=map(int,s);print(+(a&b|b&c|c&a>0)) ``` Perl 28B ```perl= print/2|3/+0while$_=<>+<>+<> ``` AWK 30B ```awk= {$1=a+=$1}NR%3<1,$0=/2|3/(a=b) ``` Fortran 2018 56B ``` 1 read*,i,j,k print*,1-ior(i,ior(j,k))/(i+j+k) goto1 end ``` Jelly 27B ``` ɠ ɠÇ47СOs3µPS%9Ẹ)Y ``` Jelly 25B ``` ƈƈ¹Ð¿Os12µs4PS%9>1) ``` Bots 103B ``` s(v){+ v 5 * v} q(x){+ x 22 ? - @ x 50 s * x ? + * 1 0 od} m(){id n +} n(){ic +} f(){m 0 m m / 2 - 20 q f} f ``` Bots 83B (postmortem) ``` s(v){+v 5*v} q(x){+x 22?-@x 50 s*x?+*1 0 od} m(){id n+} n(){ic+} f(){m 0 m m/2-20 q f} f ``` parserの仕様をちゃんと確認すべきだった。 Starry 106B (を生成するコード) ``` prog = ( label(0) + push(1) + getc + getc + swap + getn + rot + (getc + mult + rot) * 2 + getn + add + rot + getc + mult + swap + getc + mult + add + swap + getn + add + dup + dup + mult + sub + add + add + push(3) + dup + mul + mod + dup + jnz(1) + swap + label(1) + swap + putn + jnz(0) + "") ``` - `x-x*x`は加減乗除だけで0,1のとき0、2,3のとき非零の値にするイディオム。即値の生成が重いStarryではpush(2)+divより短い Cubically 85B ``` <84>~+7-2-2 <84>*0*0*0*3L<81>2L3<82>0<82>1f1 <84>f2f2f2~ F(D2~:+8!&-3-4<81>0f1<81>0f1~f3f3<82>8D2|4>4%) ``` - 解の方針は@kotatsugameと同じ - 右シフトで壊れないように、`0aa0bb0cc`の形(aaの部分に和が入る)でnotepadを作っていき、シフト時はMSBが0になることを保証する - `&146`で判定するのではなく、`>>1 |36 >36`(38も可)で判定すれば即値の問題はなくなる - 即値は以下の3状態を利用(最適性はそこまで考えていない) - F [3, 21, 18, 18, 36, 39] - FD2 [3, 20, 24, 19, 30, 39] - FD2L [12, 20, 17, 19, 33, 34] - lshift 3 (1行目ループ) - sub 24 (文字コードから48を引く) - mul 3, mul 19 (rotate時513を掛けて複製する) - lshift 17, rshift 3, rshift 20 (rotate時上下を落とす) - rshift 1, or 36, gt 36 (最後の判定。1は8番のメモリにある) Cubically 方針 by @kotatsugame `001 001 001`で壊れて涙が止まらない 即値で4,5,13,22,42(or 2,21)を用意する ``` getc set sub 48 mul 4 getc add sub 48 mul 4 getc add sub 48 getc f: mul 5 mul 13 Lshift 22 Rshift 26 getc add sub 48 f f getc f f f getc and 42 (or div 2,and 21) GT 0 print-int ``` 4(0),21(2),20(3) `UF` 2を得る回転(0) `LUB3` 5を得る回転(0),24(3),22(4) `U3R` 21(1),13(2) `B3L` 落ちちゃったコードを生成したものを記録しておきます ```ruby= ans="" # solve="▦" defun="⇒" lshift="«" rshift="»" bitand="·" g2=["LUB3","0","BU3L3"] g4=["UF","0","F3U3"] g5=["U3R","0","R3U"] g13=["B3L","2","L3B"] g20=["UF","3","F3U3"] g21=["UF","2","F3U3"] g22=["U3R","4","R3U"] g24=["U3R","3","R3U"] make=->g,op{g[0]+op+g[1]+g[2]} # getc,add,sub 48 f1=defun+"~+7"+g24[0]+("-"+g24[1])*2+g24[2] # mul 5,mul 13,Lshift 20,Rshift 24,getc,add,sub 48 f2=defun+make[g13,"*"]+g5[0]+"*"+g5[1]+lshift+g22[1]+g22[2]+g13[0]+(rshift+g13[1])*2+g13[2]+"f1" puts f1 puts f2 1.times{ #s=gets+gets+gets #s=s.bytes ans+=":0" ans+="f1" #t+=s.shift,t-=48 ans+=make[g4,"*"] #t*=W ans+="f1" #t+=s.shift,t-=48 ans+=make[g4,"*"] #t*=W ans+="f1" #t+=s.shift,t-=48 ans+="~" #s.shift ans+="f2"*3 ans+="~" ans+="f2"*3 ans+="~" ans+=make[g2,"/"] #div 2 ans+=make[g21,bitand] #and 21 # t&=(W**2+W+1)*2 ans+=">0" ans+="%" } puts ans*16 #ここはdefunしてf3*16とするべき ``` fish 34B ``` iiii0(:?;>~:fff**(?v++9%0)n i:b(?^{* > ``` ``` iiii0(?;2 v >+++9%0)n i{*i{*i{*i~{>:?!^1- ``` ``` i:0(?;v>++9%0)n v?=9l~iii< i >@@{*l3= ?^ ``` ``` >iiii~l9=?v v? =3l*{@@< \++:0(?;9%0)n ``` ``` iii1\i=?;++9%0)n {i~i/?:-1{*{i*{i* ``` Make 170B ``` x=$(foreach y,$(word 1,$1),$(if $(strip $(foreach i,00 01 10 11,$(findstring 1$i1,$y$(word 2,$1)$(word 3,$1)$y))),1,0)$(call x,$(wordlist 4,48,$1))) a:;$(call x,$(STDIN)) ``` PHP 65B ```php <?php while($_=fread(STDIN,12))echo preg_match('/1...1/s',$_.$_); ``` FerNANDo 223B ``` r s 0 t 0 u 0 v 0 w 0 x 0 q r 0 0 1 1 0 0 0 a r 0 0 1 1 0 0 0 b r 0 0 1 1 0 0 0 c r 0 0 0 0 1 0 1 0 a a S s v s a s S v a v v b b T t w t b t T w b w w c c U u x u c u U x c x x p q q p q t s t t u t R r r 0 0 r r R R 0 u r ``` MAO 111byte ``` *0:0* *1:1* 0**:B 0*:A 1**:C 1*:B *: <<:> >2:2> >0:> >1:> 0<:<* 1<:<** 2<:<2 A:0 B:1 C:2 >\n:| \n:< 2|:1 |:0 2: ``` Brainfuck(esotope) 114byte ``` ,+[->,>,>>>>,---[-[>+<-],[-<<<<<<[>>>>+>+<<<<<-]>>>>>[<<<<<+>>>>>-]>]>]<<<[<+>-]<[<+>-]<[>+<[-]],[>+++++<-]>--.,+] ``` ↓に比べて、ループのネストを減らした Brainfuck(esotope) 129byte ``` ,+[->,>,>>>>++[-[>>>+<<<-],[-]<+++[-[>+<-],[-<<<<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]>]>]>]<<<<[<+>-]<[<+>-]<[>+<[-]],[>+++++<-]>--.,+] ``` コメントあり版 ``` ,+[->,>,>>>>++ a b c 0 0 0 (2) [- [>>>+<<<-],[-]<+++ a b c 0 0 (3) 0 0 0 1 [- [>+<-], a b c 0 0 (d) 2 0 0 1 [- <<<<<[>>>+>+<<<<-]>>>> 0 b c a (a) d_1 2 0 0 1 [<<<<+>>>>-]> a b c a*1 0 (d_1) 2 0 0 1 ]> a b c a*d 0 0 (2) 0 0 1 a b c a*d b*e 0 0 (1) 0 1 a b c a*d b*e c*f 0 0 (0)1 ]> a b c a*d b*e c*f 0 0 0 (1) ] a b c a*d b*e c*f a*d*g b*e*h c*f*i 0 0 0 (0) <<<<[<+>-]<[<+>-]< a b c a*d b*e c*f (a*d*g^b*e*h^c*f*i) 0 0 0 0 [>+<[-]], a b c a*d b*e c*f (10) bool{a*d*g^b*e*h^c*f*i} 0 0 0 0 [>+++++<-]>-- a b c a*d b*e c*f 0 (bool{a*d*g^b*e*h^c*f*i}^48) 0 0 0 0 .,+] ``` Pxem 76byte ```pxem= ._1.w._.+._.+0.t.cLA.-.z.ce.z.cn.z.co.z1.tOO.aNN.aEE.aLL.a.m.o.s._.c12.-.+.a ``` 擬似コード ```virtual= A=geti() do{ B=geti(),A+=B B=geti(),A+=B reg='0' if(A!=11) if(A!=101) if(A!=110) if(A!=111) reg='1' putc(reg) A=geti() }while(A+1) ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully