QOJ.ac

QOJ

実行時間制限: 10 s メモリ制限: 256 MB 満点: 100

#23823. 数当てゲーム

統計

JOI 君は友達とゲームをすることにした.このゲームには $N$ 人のプレイヤーが参加する.$1$ 回のゲームのルールは次のようなものである:

それぞれのプレイヤーは $1$ 以上 $100$ 以下の好きな整数をカードに書いて提出する.各プレイヤーは,自分と同じ数を書いた人が他にいなかった場合,自分の書いた数と同じ得点を得る.自分と同じ数を書いた人が他にいた場合は得点を得られない.

JOI 君たちはこのゲームを $3$ 回行った.各プレイヤーが $3$ 回のゲームにおいて書いた数が与えられたとき,各プレイヤーが $3$ 回のゲームで得た合計得点を求めるプログラムを作成せよ.

入力

入力は $1 + N$ 行からなる.

$1$ 行目には整数 $N$ ($2 \le N \le 200$) が書かれており,プレイヤーの人数を表す.

続く $N$ 行のうちの $i$ 行目 ($1 \le i \le N$) には $3$ つの $1$ 以上 $100$ 以下の整数が空白を区切りとして書かれており,それぞれ $i$ 人目のプレイヤーが $1$ 回目,$2$ 回目,$3$ 回目のゲームで書いた数を表す.

出力

出力は $N$ 行からなる.

$i$ 行目 ($1 \le i \le N$) には $i$ 人目のプレイヤーが $3$ 回のゲームで得た合計得点を表す整数を出力せよ.

入出力例

入力例 1

5
100 99 98
100 97 92
63 89 63
99 99 99
89 97 98

出力例 1

0
92
215
198
89

注記

入力例 1 では,各プレイヤーが $3$ 回のゲームで得た得点の詳細は次のようになる:

  • プレイヤー $1$: $0 + 0 + 0 = 0$
  • プレイヤー $2$: $0 + 0 + 92 = 92$
  • プレイヤー $3$: $63 + 89 + 63 = 215$
  • プレイヤー $4$: $99 + 0 + 99 = 198$
  • プレイヤー $5$: $89 + 0 + 0 = 89$

入力例 2

3
89 92 77
89 92 63
89 63 77

出力例 2

0
63
63

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.