QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 128 MB Total points: 100

#4131. 泉

统计

济南,中国环渤海地区南翼和黄河中下游地区中心城市,山东省省会,山东省第一大城 市,山东省政治、文化、教育中心,华东五大城市之一,区域性金融中心,副省级城市。济南位于山东省中西部,北临黄河,南依泰山。济南分别与西南部的聊城、北部的德州和滨州, 东部的淄博、南部的莱芜和泰安交界。济南有着2700余年的历史,是龙山文化的发祥地。 因境内有“七十二名泉”故被称为“泉城”,并素有“四面荷花三面柳,一城山色半城湖” 的美誉“济南历史上涌现了很多文人墨客,著名有李清照、辛弃疾等。济南是国家创新型城市、中国软件名城、全国重耍的交通枢纽和物流中心。继济南全运会取得圆满成功后,2013 年济南将举办第十届中国艺术节,并成为2015年“第二十二届国际历史科学大会”的主办 城市,为济南建设国际大都市注入了新的活力。

济南市“泉历史研究小组”依据济南特有的泉脉关系将济南的泉水分为六个区域,分别是市中区、历下区、天桥区、槐荫区、历城区、长清区。

作为光荣的济南泉历史研究小组中的一员,铭铭收集了历史上N个不同年份时不同泉区 的泉水流量指数,这个指数是一个小于 $2^{30}$ 的非负整数。第i个年份时六个泉区的泉水流量指数分别为 $A(i,1)$, $A(i,2)$, $A(i,3)$, $A(i,4)$, $A(i,5)$ 与 $A(i,6)$。

现在铭铭希望知道有多少对不同的年份:$i$ 和 $j$,满足这两年恰好有 $K$ 个泉区的泉水流量指数对应相同。

输入格式

第一行有 $2$ 个整数,分别是 $N$ 和 $K$。

之后 $N$ 行,每行有 $6$ 个整数。第 $i$ 行的第 $j$ 个数字 $A(i, j)$ 表示第 $i$ 个年份中第 $j$ 个泉区的泉水流量指数。

输出格式

只一行,一个整数。表示有多少对不同的年份,满足恰有 $K$ 个泉区的泉水流量指数对应相同。

样例数据

样例输入

3 3
1 2 3 4 5 6
1 2 3 0 0 0
0 0 0 4 5 6

样例输出

2

子任务

测试点 特殊性质
$1 \sim 4$ $N = 1\,000$
$5 \sim 11$ $N = 10^4$
$12 \sim 17$ $A(i,j) \leq 18$
$18 \sim 25$

对于 $100\%$ 的数据,$1 \leq N \leq 10^5$,$0 \leq K \leq 6$,且所有数据中 $K$ 是等概率出现的,即对于任意的 $0 \leq x \leq 6$,都有大约 $1/7$ 的数据中 $K=x$。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.