CF231A.Team

入门

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

One day three best friends Petya, Vasya and Tonya decided to form a team and take part in programming contests. Participants are usually offered several problems during programming contests. Long before the start the friends decided that they will implement a problem if at least two of them are sure about the solution. Otherwise, the friends won't write the problem's solution.

This contest offers n problems to the participants. For each problem we know, which friend is sure about the solution. Help the friends find the number of problems for which they will write a solution.

一天,三位最好的朋友佩蒂亚、瓦夏和托尼娅决定组成一支队伍,参加编程竞赛。在编程竞赛中,参赛者通常会面对若干道题目。早在比赛开始前,朋友们就约定:当且仅当三人中至少有两人对某题的解法有把握时,他们才会实现该题的解法;否则,他们不会编写该题的解答。

本次竞赛共提供 nn 道题目。对于每道题目,我们知道哪几位朋友对该题的解法有把握。请帮助这三位朋友计算:他们将编写解答的题目数量。

输入格式

The first input line contains a single integer n (1 ≤ n ≤ 1000) — the number of problems in the contest. Then n lines contain three integers each, each integer is either 0 or 1. If the first number in the line equals 1, then Petya is sure about the problem's solution, otherwise he isn't sure. The second number shows Vasya's view on the solution, the third number shows Tonya's view. The numbers on the lines are separated by spaces.

第一行输入包含一个整数 nn(1≤n≤10001 \leq n \leq 1000)—— 表示竞赛中问题的数量。接下来的 nn 行每行包含三个整数,每个整数为 00 或 11。若某行的第一个数字为 11,则表示 Petya 确信该问题的解答是正确的;否则他不确定。第二个数字表示 Vasya 对该问题解答的看法,第三个数字表示 Tonya 的看法。每行中的数字以空格分隔。

输出格式

Print a single integer — the number of problems the friends will implement on the contest.

输出一个整数——朋友们将在比赛中解决的问题数量。

输入输出样例

  • 输入#1

    3
    1 1 0
    1 1 1
    1 0 0

    输出#1

    2
  • 输入#2

    2
    1 0 0
    0 1 1

    输出#2

    1

说明/提示

In the first sample Petya and Vasya are sure that they know how to solve the first problem and all three of them know how to solve the second problem. That means that they will write solutions for these problems. Only Petya is sure about the solution for the third problem, but that isn't enough, so the friends won't take it.

In the second sample the friends will only implement the second problem, as Vasya and Tonya are sure about the solution.

在第一个样例中,Petya 和 Vasya 确信自己会解第一题,且三人全都确信自己会解第二题。这意味着他们将为这两道题写出解答。只有 Petya 确信自己会解第三题,但这并不足够,因此朋友们不会选择该题。

在第二个样例中,朋友们只会实现第二题,因为 Vasya 和 Tonya 都确信自己会解该题。

输入解题思路,AI测评打分。不知道怎么写?

首页