結果

問題 No.314 ケンケンパ
ユーザー LeonardoneLeonardone
提出日時 2015-12-08 20:14:10
言語 Bash
(Bash 5.1.16)
結果
TLE  
実行時間 -
コード長 317 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 5,340 KB
実行使用メモリ 11,848 KB
最終ジャッジ日時 2023-10-12 22:09:30
合計ジャッジ時間 4,445 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/bin/bash

# yukicoder My Practice
# author: Leonardone @ NEETSDKASU

# 解説読後
# http://yukicoder.me/problems/882/editorial

typeset -i n a b c t

mapfile -t n

a=0
b=1
c=0

for ((n=$n-1;$n;n--)); do {
    t=$(((b+c) % 1000000007));
    c=$b;
    b=$a;
    a=$t;
}; done;

t=$(((a+b+c) % 1000000007))

echo $t
0