結果
| 問題 | No.24 数当てゲーム | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-09-03 02:44:07 | 
| 言語 | Scheme (Gauche-0.9.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 84 ms / 5,000 ms | 
| コード長 | 699 bytes | 
| コンパイル時間 | 158 ms | 
| コンパイル使用メモリ | 6,944 KB | 
| 実行使用メモリ | 27,092 KB | 
| 最終ジャッジ日時 | 2024-12-21 10:54:03 | 
| 合計ジャッジ時間 | 2,500 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
(use scheme.set)
(define (read-number)
  (string->number (read-line)))
(define (solve matrix)
  (define neg-set (set eq-comparator))
  (define pos-set (apply set eq-comparator (iota 10)))
  (dolist (l (filter (lambda (line)
		       (eqv? (last line) 'NO)) matrix))
	  (list->set! neg-set (take l 4)))
  (dolist (l (filter (lambda (line)
		       (eqv? (last line) 'YES)) matrix))
	  (set-intersection! pos-set (list->set eq-comparator (take l 4))))
  (car (filter (lambda (n) (and (set-contains? pos-set n)
			   (not (set-contains? neg-set n)))) (iota 10))))
(let* ((n (read-number))
       (matrix
	(map (lambda (_) (map (lambda (_) (read)) (iota 5))) (iota n))))
  (print (solve matrix)))
            
            
            
        