RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
USACO0571

Field Day

Silver II 실버 II
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

*Note: The time limit for this problem in Python is 15s. Other languages have the default time limit of 2s.*

Each of Farmer John's \(N\) barns (\(2\le N\le 10^5\)) has selected a team of \(C\)
cows (\(1\le C\le 18\)) to participate in field day. The breed of every cow is
either a Guernsey or a Holstein.

The difference between two teams is defined to be the number of positions \(i\)
(\(1 \leq i \leq C\)) at which the breeds of the cows in the \(i\)th positions
differ. For every team \(t\) from \(1 \ldots N\), please compute the maximum
difference between team \(t\) and any other team.

Problem credits: Benjamin Qi

제약

SCORING

  • Inputs 2-5: \(C = 10\)
  • Inputs 6-9: All answers are at least \(C-3\).
  • Inputs 10-20: No additional constraints.

Problem credits: Benjamin Qi

입력 형식

The first line contains \(C\) and \(N\).

The next \(N\) lines each contain a string of length \(C\) of Gs and Hs. Each line
corresponds to a team.

출력 형식

For each team, print the maximum difference.

예제 1
입력
5 3
GHGGH
GHHHH
HGHHG
출력
5
3
5
설명

The first and third teams differ by \(5\). The second and third teams differ by
\(3\).

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2022-2023 > US Open > Silver

태그

평가 및 의견

Field Day

개요
출제자 난이도 Silver II 실버 II 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Field Day

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8