問題一覧 > 通常問題

No.3010 Cyan Coder

レベル : / AI推定難易度 : 104 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 302
作問者 : ゆにたりー卿 / テスター : 👑 binap 👑 loop0919 Rice_tawara459 eom2357 Apollo@Kuro
お気に入りにしたユーザー ProblemId : 11709 / 自分の提出
問題文最終更新日: 2025-01-25 12:35:58
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
第1回 岩井星人アンソロジープログラミングコンテスト (順位表) の他の問題:

Problem Statement

A programming contest with $N$ participants was held, and $M$ problems were set.
For each $i\ (1\leq i \leq N)$, you are given a string $S_i$ representing which problems participant $i$ solved correctly. $S_i$ is a string of length $M$ consisting of o,x. If the $j$-th character of $S_i$ is o, participant $i$ solved problem $j$ correctly; if it is x, the participant failed to solve it correctly.
Also, participant $i$ has a numerical value $R_i$ called their rating.

Now, all participants were shown the following taunting image.

Taunting image (collapsed)

As a result of being shown the taunting image, for each $i\ (1\leq i \leq N)$, participant $i$ faints if and only if both of the following conditions are satisfied.
  • $R_i \geq 1200$.
  • The participant failed to solve at least $1$ of problems $1,\ 2,\ 3,\ 4$.
Answer how many of the participants fainted.

Constraints

  • $1 \leq N \leq 2 \times 10^5$
  • $4 \leq M \leq 10$
  • $0 \leq R_i \leq 5000$
  • $S_i$ is a string of length $M$ consisting of o x

Input

The input is given from standard input in the following format.

$N\ M$
$S_1\ R_1$
$\vdots$
$S_N\ R_N$

Output

Output the total number of participants who fainted.

Sample

Sample 1
Input
4 7
xxooooo 1000
oooooxo 1400
oooxxox 1300
ooxoxxx 1200
Output
2

Participant $1$ did not solve problems $1$ and $2$, but does not faint because their rating is less than $1200$.
Participant $2$ has a rating of at least $1200$, but does not faint because they solved all of problems $1,\ 2,\ 3,\ 4$.
Participant $3$ did not solve problem $1$ and has a rating of at least $1200$, so they faint.
Participant $4$ did not solve problem $3$ and has a rating of at least $1200$, so they faint.
In the end, $2$ of the participants fainted.

Sample 2
Input
3 5
oooox 1500
ooxxo 1100
xxxxx 800
Output
0

None of the participants faint.

Sample 3
Input
8 10
ooooooxxxx 1500
oooxoxoxox 1600
xxoxxxxxxx 400
ooooxxxxxx 600
oooooooooo 2300
xoxxxoxoxo 1200
oooxoxoxox 1300
ooooxxxxxx 400
Output
3

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。