Submission #68741250
Source Code Expand
import bisect, heapq, sys, math, copy, itertools, decimal
from collections import defaultdict, deque
sys.setrecursionlimit(10**7)
def INT(): return int(input())
def MI(d=0): return map(lambda x:int(x)+d, input().split())
def MS(): return map(str, input().split())
def LI(d=0): return list(map(lambda x:int(x)+d, input().split()))
def LS(): return list(map(str, input().split()))
def pr_line(itr): print(*itr, sep='\n')
def pr_mtx(matrix): [print(*row) for row in matrix]
dij = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dij2 = [[1, 0], [0, 1], [-1, 0], [0, -1], [1, 1], [1, -1], [-1, 1], [-1, -1]]
INF = float('inf')
N, M = MI()
S = [input() for _ in range(N)]
score = [0]*N
for i in range(M):
cnt0, cnt1 = 0, 0
for j in range(N):
if S[j][i] == '0':
cnt0 += 1
else:
cnt1 += 1
for j in range(N):
if cnt0 > cnt1:
if S[j][i] == '1':
score[j] += 1
else:
if S[j][i] == '0':
score[j] += 1
mx = max(score)
ans = [i+1 for i in range(N) if score[i] == mx]
print(*ans)
Submission Info
| Submission Time |
|
| Task |
B - Most Minority |
| User |
BenKenobi |
| Language |
Python (PyPy 3.10-v7.3.12) |
| Score |
200 |
| Code Size |
1123 Byte |
| Status |
AC |
| Exec Time |
188 ms |
| Memory |
95736 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
200 / 200 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
sample_01.txt, sample_02.txt, sample_03.txt |
| All |
sample_01.txt, sample_02.txt, sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt |
| Case Name |
Status |
Exec Time |
Memory |
| sample_01.txt |
AC |
175 ms |
95068 KiB |
| sample_02.txt |
AC |
179 ms |
95036 KiB |
| sample_03.txt |
AC |
179 ms |
94616 KiB |
| test_01.txt |
AC |
177 ms |
95000 KiB |
| test_02.txt |
AC |
174 ms |
94968 KiB |
| test_03.txt |
AC |
184 ms |
95664 KiB |
| test_04.txt |
AC |
177 ms |
94988 KiB |
| test_05.txt |
AC |
178 ms |
95080 KiB |
| test_06.txt |
AC |
180 ms |
94868 KiB |
| test_07.txt |
AC |
186 ms |
95544 KiB |
| test_08.txt |
AC |
183 ms |
94628 KiB |
| test_09.txt |
AC |
188 ms |
95484 KiB |
| test_10.txt |
AC |
186 ms |
95736 KiB |
| test_11.txt |
AC |
185 ms |
95576 KiB |
| test_12.txt |
AC |
185 ms |
95648 KiB |
| test_13.txt |
AC |
186 ms |
95672 KiB |
| test_14.txt |
AC |
184 ms |
95568 KiB |
| test_15.txt |
AC |
181 ms |
95068 KiB |
| test_16.txt |
AC |
179 ms |
94928 KiB |
| test_17.txt |
AC |
178 ms |
94856 KiB |
| test_18.txt |
AC |
177 ms |
95108 KiB |
| test_19.txt |
AC |
184 ms |
95520 KiB |
| test_20.txt |
AC |
184 ms |
95516 KiB |
| test_21.txt |
AC |
180 ms |
95680 KiB |
| test_22.txt |
AC |
179 ms |
95532 KiB |
| test_23.txt |
AC |
176 ms |
95492 KiB |
| test_24.txt |
AC |
179 ms |
95536 KiB |