Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

6 of 6
added 2 characters in body
AZTECCO
  • 11k
  • 1
  • 17
  • 60

C++ (gcc), (削除) 148 (削除ここまで) 142 bytes

#import<queue>
#define q[o[i/z]*z+o[i%z]]
using V=std::vector<int>;int f(V m,V o,V&r,V&R,int z){int i=z*z;for(r=R=V(i);i--;r[i]=m q)R q=m[i];}

Try it online!

Thanks to @ceilingcat suggestion to use #import <queue> instead of <vector> which mysteriously brings std::vector

AZTECCO
  • 11k
  • 1
  • 17
  • 60

AltStyle によって変換されたページ (->オリジナル) /