結果
問題 | No.706 多眼生物の調査 |
ユーザー | youmen33018173 |
提出日時 | 2018-08-18 11:06:20 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 996 bytes |
コンパイル時間 | 117 ms |
コンパイル使用メモリ | 10,992 KB |
実行使用メモリ | 9,208 KB |
最終ジャッジ日時 | 2023-08-03 16:13:11 |
合計ジャッジ時間 | 1,139 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 19 ms
8,396 KB |
testcase_01 | AC | 20 ms
8,588 KB |
testcase_02 | AC | 19 ms
8,576 KB |
testcase_03 | AC | 20 ms
8,632 KB |
testcase_04 | AC | 22 ms
8,620 KB |
testcase_05 | AC | 30 ms
8,832 KB |
testcase_06 | AC | 50 ms
9,208 KB |
testcase_07 | AC | 19 ms
8,396 KB |
ソースコード
# coding: utf-8 # Your code here! from collections import Counter class Counters(): def __init__ (self, chars): self.x = chars def count_x (self, x, y): ans = [] for lst in self.x: count_num = 0 for chars in lst: if x == chars or y == chars: continue else: count_num = count_num + 1 ans.append(count_num) answer = Counter(ans).most_common() last_answer = None for taple in answer: if last_answer == None: last_answer = taple elif taple[1] == last_answer[1]: if taple[0] >= last_answer[0]: last_answer = taple else: continue else: break return last_answer[0] lst = [] for x in range(int(input())): lst.append(input()) test = Counters(lst) print(test.count_x('(', ')'))