結果
問題 | No.762 PDCAパス |
ユーザー | ducktail |
提出日時 | 2018-12-12 23:09:43 |
言語 | Scheme (Gauche-0.9.14) |
結果 |
AC
|
実行時間 | 409 ms / 2,000 ms |
コード長 | 1,690 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 6,816 KB |
実行使用メモリ | 34,976 KB |
最終ジャッジ日時 | 2024-09-25 03:42:42 |
合計ジャッジ時間 | 7,927 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 27 ms
16,000 KB |
testcase_01 | AC | 25 ms
16,128 KB |
testcase_02 | AC | 25 ms
16,256 KB |
testcase_03 | AC | 25 ms
16,000 KB |
testcase_04 | AC | 25 ms
16,000 KB |
testcase_05 | AC | 26 ms
16,000 KB |
testcase_06 | AC | 26 ms
16,256 KB |
testcase_07 | AC | 26 ms
16,000 KB |
testcase_08 | AC | 26 ms
16,000 KB |
testcase_09 | AC | 25 ms
16,000 KB |
testcase_10 | AC | 25 ms
16,000 KB |
testcase_11 | AC | 26 ms
16,000 KB |
testcase_12 | AC | 25 ms
16,000 KB |
testcase_13 | AC | 25 ms
16,000 KB |
testcase_14 | AC | 27 ms
16,000 KB |
testcase_15 | AC | 26 ms
16,128 KB |
testcase_16 | AC | 25 ms
16,000 KB |
testcase_17 | AC | 26 ms
16,128 KB |
testcase_18 | AC | 27 ms
16,000 KB |
testcase_19 | AC | 26 ms
16,000 KB |
testcase_20 | AC | 26 ms
16,000 KB |
testcase_21 | AC | 26 ms
16,000 KB |
testcase_22 | AC | 207 ms
25,868 KB |
testcase_23 | AC | 205 ms
25,088 KB |
testcase_24 | AC | 333 ms
34,976 KB |
testcase_25 | AC | 334 ms
34,752 KB |
testcase_26 | AC | 236 ms
27,236 KB |
testcase_27 | AC | 233 ms
27,468 KB |
testcase_28 | AC | 409 ms
34,876 KB |
testcase_29 | AC | 407 ms
34,700 KB |
testcase_30 | AC | 372 ms
28,648 KB |
testcase_31 | AC | 397 ms
28,840 KB |
testcase_32 | AC | 380 ms
28,724 KB |
testcase_33 | AC | 348 ms
28,192 KB |
testcase_34 | AC | 358 ms
28,160 KB |
testcase_35 | AC | 345 ms
28,288 KB |
testcase_36 | AC | 260 ms
27,356 KB |
testcase_37 | AC | 259 ms
27,460 KB |
testcase_38 | AC | 263 ms
27,232 KB |
testcase_39 | AC | 267 ms
27,492 KB |
testcase_40 | AC | 263 ms
27,232 KB |
ソースコード
(define (main args) (let* ([n (read)] [m (read)] [chv (string->vector (symbol->string (read)))] [adv (make-vector n '())] [ctv (make-vector n 0)] [md (+ 7 (expt 10 9))]) (let loop ([x m]) (cond [(zero? x) #t] [else (let* ([p1 (- (read) 1)] [p2 (- (read) 1)]) (vector-set! adv p1 (cons p2 (vector-ref adv p1))) (vector-set! adv p2 (cons p1 (vector-ref adv p2)))) (loop (- x 1))])) (for-each (^i (vector-set! ctv i (length (filter (^j (eq? #\A (vector-ref chv j))) (vector-ref adv i))))) (filter (^i (eq? #\C (vector-ref chv i))) (iota n))) (for-each (^i (vector-set! ctv i (remainder (apply + (map (^j (vector-ref ctv j)) (filter (^j (eq? #\C (vector-ref chv j))) (vector-ref adv i)))) md))) (filter (^i (eq? #\D (vector-ref chv i))) (iota n))) (for-each (^i (vector-set! ctv i (remainder (apply + (map (^j (vector-ref ctv j)) (filter (^j (eq? #\D (vector-ref chv j))) (vector-ref adv i)))) md))) (filter (^i (eq? #\P (vector-ref chv i))) (iota n))) (print (remainder (apply + (map (^j (vector-ref ctv j)) (filter (^i (eq? #\P (vector-ref chv i))) (iota n)))) md))) 0)