結果

問題 No.791 うし数列
ユーザー ducktailducktail
提出日時 2019-07-30 16:14:46
言語 Scheme
(Gauche-0.9.14)
結果
WA  
実行時間 -
コード長 237 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 11,944 KB
最終ジャッジ日時 2023-09-18 07:22:49
合計ジャッジ時間 1,114 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
11,832 KB
testcase_01 AC 17 ms
11,684 KB
testcase_02 WA -
testcase_03 AC 18 ms
11,708 KB
testcase_04 AC 18 ms
11,692 KB
testcase_05 AC 18 ms
11,840 KB
testcase_06 AC 17 ms
11,620 KB
testcase_07 AC 17 ms
11,760 KB
testcase_08 AC 18 ms
11,700 KB
testcase_09 AC 17 ms
11,860 KB
testcase_10 AC 17 ms
11,628 KB
testcase_11 AC 17 ms
11,660 KB
testcase_12 AC 17 ms
11,608 KB
testcase_13 AC 17 ms
11,680 KB
testcase_14 AC 18 ms
11,680 KB
testcase_15 AC 17 ms
11,608 KB
testcase_16 AC 17 ms
11,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve ls)
  (cond [(and (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