n入力として整数を指定すると、、n繰り返しn回数を含むリストを返します。たとえば、プログラムは5それを取得してに変換し[5,5,5,5,5]ます。要素は、文字列ではなく整数である必要があります。タスクを実行する組み込み関数は許可されていません。
これはcode-golfなので、標準のルールが適用されます。
built-in。
                *演算子は大丈夫ですか?大丈夫ではないビルトインの例は何ですか?
                n入力として整数を指定すると、、n繰り返しn回数を含むリストを返します。たとえば、プログラムは5それを取得してに変換し[5,5,5,5,5]ます。要素は、文字列ではなく整数である必要があります。タスクを実行する組み込み関数は許可されていません。
これはcode-golfなので、標準のルールが適用されます。
built-in。
                *演算子は大丈夫ですか?大丈夫ではないビルトインの例は何ですか?
                回答:
x
これは組み込みの「繰り返し時間」ではないことに注意してくださいn n。その機能はそれよりも一般的です。たとえば、4,5,6x1,2,3等しい[4, 5, 5, 6, 6, 6]。一つだけの引数を考えると、ゼリーはちょうど付属リンクの左と右の引数の両方としてそれを使用するために起こりますが、この機能ではありません内在しますx。
これが考慮されない場合、さまざまな楽しい2バイトの選択肢があります。
x` ṁ` Ra Rị R» a€ oR oḶ oṬ oẊ Ḷị Ḷ» Ṭị Ṭ» Ẋị Ẋ» ị€ ṛ€ ȧ€ »€
等
x「すべての仕事」でしたが、それは最も確かにしません-リンク解析すると、アレイ・強制・ロジックは、この中を有効にするに行くの暗黙の「0バイト」がありますrepeat([n], n)正確に何他の回答であるが、行う。
                    ṁし、ẋそう、この答えは3のいずれかの可能性が。「繰り返しn n時間」には3つのビルトイン(希望する人はいない)がないため、すべてを「ビルトイン」にすることはできません。
                    f={a=[];t=_this;while{count a<t}do{a=a+[t]};a}
で呼び出す:
hint format["%1", 5 call f]
出力:
i--および+=これがありますか?
                    5つの短いソリューション。最後の2つはZacharýの好意によるものです。
⍴⍨⍴ 周期的にr eshape
⍨ 自己
/⍨/ 複製する
⍨ 自己
\⍨\ 展開する
⍨ 自己
⌿⍨⌿ 最初の(そして唯一の)軸に沿って複製する 
⍨ 自己
⍀⍨⍀ 最初の(そして唯一の)軸に沿って展開する
⍨ 自己
⌿⍨と⍀⍨仕事。
                    ⍨入力して挿入できます。
                    *]
*]QQ - Full program with implicit input ] - Turn the input into a list. * - Repeat it a number of times equal to the input.
f n=n<$[1..n]Try it online! Usage: f 5 yields [5,5,5,5,5]. For n=5, [1..n] yields the list [1,2,3,4,5]. n<$ replaces each element of this list with n.
join replicate
                    join is not part of Prelude and thus requiers a lengthy import Control.Monad, which rarely makes it useful for golfing.
                    rep(n<-scan(),n) too close to a builtin?
                    .D).
                    	f f r 2
2
	
	
r
	r d
	f s t f
d
	dip f s t
	f
t
	dot f
	dot
s
	s dip
f
	dab
f is an alias for dab (tail).
s is subtraction, as explained on the wiki: (x, y) → (0, y−x) when x ≤ y.
t maps (a, b, c…) to (b+c+…, a+b+c+…).
f s t maps (a, b, c…) to a. This is our “head” function.
d dips only the head of its argument: (a, b, c…) → (|a−1|, b, c…)
r is the main repetition logic. We map (a, b) to (*r(|a−1|, b), b).
For example, r(4, 7) will evaluate as
  r(4, 7)
= r(3, 7), 7
= r(2, 7), 7, 7
= r(1, 7), 7, 7, 7
= r(0, 7), 7, 7, 7, 7
  → This would call r(1, 7), but (1, 7) ≥ (0, 7), so surrender!
= 0, 7, 7, 7, 7, 7.
Finally, we define 2, which maps n → (n, n), and define main as f f r 2, computing r(n, n) and chopping off the first two elements.
\newcommand{\f}[1]{#1\count0=2\loop,#1\advance\count0 by1\ifnum\count0<#1\repeat}
\documentclass[12pt,a4paper]{article}
\begin{document}
\newcommand{\f}[1]{#1\count0=2\loop,#1\advance\count0 by1\ifnum\count0<#1\repeat}
\f{5}
\f{10}
\end{document}
´R
´    -- Apply next function twice to same argument
 R   -- given an integer n and some element, replicate the element n-times
ṠIR
replicate>>=id
Thanks to @nimi, I don't need any import anymore. Yay!
It's a function that takes an integer argument; for example, the following returns [5,5,5,5,5]:
(replicate>>=id) 5
id=<<replicate? It's also 14 bytes but doesn't need the import.
                    n->java.util.Arrays.stream(new int[n]).map(i->n)-2 bytes thanks to @Jakob
Inspired by the comments in @OlivierGrégoire's post, and optimized a little further. Takes an integer input, creates an IntStream of n elements, then maps each element to n and returns it.
java.util.Arrays.stream(new int[n]).
                    -4 bytes thanks to @DomHastings
sub{(@_)x"@_"}Is x a builtin that does the entire task? Sort of? Not really? Rules unclear?
Edit: Yeah, probably it's fine.
$_[0] to @_! Also the second can be"@_" I think...
                    $_=$_ x$_ with perl -pe?
                    x does string repetition, not list repetition, unless the left operand is in parentheses (or is a qw operator) and the x is evaluated in list context.  And of course $_ is a scalar, not a list.
                    $~
Same as the APL answer: reflexively shape the input. In other words:
$~ y
y $ y
NB. y copies of y
>-[-[-<]>>+<]>->#[->+>+<<]>>[-<;<<.>>>]
Prints N N times. Works by generating 32, taking input, then duplicating the input twice, then output the first for each 1 in the second.
int*f(k){int*r=malloc(k*4),a=k;for(;a-->0;)r[a]=k;k=r;}Returns a list of k integers.
eax for locals. Go figure.
                    *f(k){int r[k], instead of int*f(k){int*r=malloc(k*4),
                    {[[_]*_1]}
Explanation:
{[[_]*_1]}
{        } /* Anonymous function   */
   _       /* The input (_1)       */
  [ ]      /* As a list            */
     *_1   /* Repeated _1 times    */
 [      ]  /* Pushed to the stream */
[_]*_ = [_1]*_2. Because the first underscore is the first, it has automatically the number 1.
                    [->+>+<<]>[->.<]
[->+>+<<]          Duplicate 'n' into the next 2 cells to the right
         >         Move to the first duplicate
          [->.<]   Print 'n', 'n' times
As I'm sure you're aware,  brainfuck takes input and output values as ASCII characters. So a ! is represented as the value 33.
yes $1|sed $1q
As a zsh function, 20 19 bytes:
f(){yes $1|sed $1q}
yes $1|sed $1q?
                    declare -i integer variables.  But it also has to be an array.  I'm not sure bash even supports an integer array (like eval declare -ia "$1" to use the first function arg as the name of an array return value.)  I upvoted this because it follows the spirit of the question; I doubt the question meant to exclude languages that don't really have integer lists / arrays.
                    tY"
Explanation:
t       % duplicate elements
Y"      % replicate elements of array
        % (implicit) convert to string and display
n->{int a[]=new int[n],i=n;for(;i-->0;)a[i]=n;return a;}-2 bytes thanks to @KevinCruijssen
n->{int a[]=new int[n],i=n;for(;i-->0;)a[i]=n;return a;}
                    IntStream.generate(() -> n).limit(n) but decided it wasn't worth typing up and upvoted this instead :)
                    Array.init. Just assign it to a variable with a type alias, and boom: let f: (Int, Int) -> [Int] = Array.init; print(f(5, 5))