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 Answer

added 2 characters in body
Source Link
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 &#60 queue><queue> instead of &#60 vector><vector> which mysteriously brings std::vector

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 &#60 queue> instead of &#60 vector> which mysteriously brings std::vector

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

added 2 characters in body
Source Link
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 &#60 queue> instead of which&#60 vector> which mysteriously brings std::vector

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 instead of which mysteriously brings std::vector

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 &#60 queue> instead of &#60 vector> which mysteriously brings std::vector

@ceilingcat suggestion
Source Link
AZTECCO
  • 11k
  • 1
  • 17
  • 60

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

#import<vector>#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! Try it online!

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

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

#import<vector>
#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!

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 instead of which mysteriously brings std::vector

r=R=V(i) instead of r=V(i),R=V(i)
Source Link
AZTECCO
  • 11k
  • 1
  • 17
  • 60
Loading
Corrected to a valid i/o method.
Source Link
AZTECCO
  • 11k
  • 1
  • 17
  • 60
Loading
Source Link
AZTECCO
  • 11k
  • 1
  • 17
  • 60
Loading

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