結果

問題 No.791 うし数列
ユーザー ducktailducktail
提出日時 2019-07-30 16:17:29
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 76 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 13,784 KB
最終ジャッジ日時 2023-09-18 07:27:37
合計ジャッジ時間 1,210 ms
ジャッジサーバーID
(参考情報)
judge15 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,840 KB
testcase_01 AC 19 ms
13,784 KB
testcase_02 AC 18 ms
11,788 KB
testcase_03 AC 19 ms
11,760 KB
testcase_04 AC 17 ms
11,616 KB
testcase_05 AC 18 ms
11,688 KB
testcase_06 AC 17 ms
11,712 KB
testcase_07 AC 17 ms
11,836 KB
testcase_08 AC 17 ms
11,780 KB
testcase_09 AC 18 ms
11,628 KB
testcase_10 AC 18 ms
11,800 KB
testcase_11 AC 17 ms
11,804 KB
testcase_12 AC 17 ms
11,764 KB
testcase_13 AC 18 ms
11,912 KB
testcase_14 AC 18 ms
11,888 KB
testcase_15 AC 18 ms
11,880 KB
testcase_16 AC 18 ms
11,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve ls)
  (cond [(and (>= (length ls) 2)
              (char=? (car ls) #\1)
              (every (cut char=? <> #\3) (cdr ls))) (length (cdr ls))]
        [else -1]))

(define (main args)
  (let ([ls (string->list (read-line))])
    (print (solve ls)))
  0)
0