結果
問題 | No.762 PDCAパス |
ユーザー | ducktail |
提出日時 | 2018-12-12 23:05:01 |
言語 | Scheme (Gauche-0.9.14) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,619 bytes |
コンパイル時間 | 68 ms |
コンパイル使用メモリ | 6,816 KB |
実行使用メモリ | 34,740 KB |
最終ジャッジ日時 | 2024-09-25 03:42:27 |
合計ジャッジ時間 | 7,838 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 25 ms
16,000 KB |
testcase_01 | AC | 24 ms
16,000 KB |
testcase_02 | AC | 24 ms
16,000 KB |
testcase_03 | AC | 24 ms
16,128 KB |
testcase_04 | AC | 26 ms
16,000 KB |
testcase_05 | AC | 26 ms
16,256 KB |
testcase_06 | AC | 24 ms
16,128 KB |
testcase_07 | AC | 24 ms
16,000 KB |
testcase_08 | AC | 24 ms
16,128 KB |
testcase_09 | AC | 25 ms
16,128 KB |
testcase_10 | AC | 24 ms
16,000 KB |
testcase_11 | AC | 24 ms
16,000 KB |
testcase_12 | AC | 24 ms
16,000 KB |
testcase_13 | AC | 24 ms
16,128 KB |
testcase_14 | AC | 24 ms
16,000 KB |
testcase_15 | AC | 25 ms
16,000 KB |
testcase_16 | AC | 24 ms
16,000 KB |
testcase_17 | AC | 25 ms
16,000 KB |
testcase_18 | AC | 24 ms
16,000 KB |
testcase_19 | AC | 25 ms
16,000 KB |
testcase_20 | AC | 25 ms
16,128 KB |
testcase_21 | AC | 25 ms
16,128 KB |
testcase_22 | AC | 201 ms
26,280 KB |
testcase_23 | AC | 202 ms
24,968 KB |
testcase_24 | AC | 323 ms
34,684 KB |
testcase_25 | AC | 311 ms
34,712 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 391 ms
34,732 KB |
testcase_29 | AC | 391 ms
34,740 KB |
testcase_30 | AC | 388 ms
28,720 KB |
testcase_31 | AC | 391 ms
28,672 KB |
testcase_32 | AC | 392 ms
28,696 KB |
testcase_33 | AC | 345 ms
28,344 KB |
testcase_34 | AC | 344 ms
28,376 KB |
testcase_35 | AC | 348 ms
28,156 KB |
testcase_36 | AC | 257 ms
27,320 KB |
testcase_37 | AC | 251 ms
27,264 KB |
testcase_38 | AC | 258 ms
27,304 KB |
testcase_39 | AC | 255 ms
27,248 KB |
testcase_40 | AC | 250 ms
27,284 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 (apply + (map (^j (vector-ref ctv j)) (filter (^j (eq? #\C (vector-ref chv j))) (vector-ref adv i)))))) (filter (^i (eq? #\D (vector-ref chv i))) (iota n))) (for-each (^i (vector-set! ctv i (apply + (map (^j (vector-ref ctv j)) (filter (^j (eq? #\D (vector-ref chv j))) (vector-ref adv i)))))) (filter (^i (eq? #\P (vector-ref chv i))) (iota n))) (print (apply + (map (^j (vector-ref ctv j)) (filter (^i (eq? #\P (vector-ref chv i))) (iota n)))))) 0)