CodeForces615A-Bulbs-

水题

 1 #include <cstdio>
 2 #include <algorithm>
 3
 4 using namespace std;
 5
 6 int N,M,save[1000];
 7
 8 int main()
 9 {
10     scanf("%d%d",&N,&M);
11     for(int i=0,t,tt;i<N;i++)
12     {
13         scanf("%d",&t);
14         for(int j=0;j<t;j++)
15         {
16             scanf("%d",&tt);
17             save[tt] = 1;
18         }
19     }
20     for(int i=1;i<=M;i++)
21     {
22         if(save[i] == 0)
23         {
24             printf("NO\n");
25             return 0;
26         }
27     }
28     printf("YES\n");
29     return 0;
30 }
时间: 2024-11-07 08:50:12

CodeForces615A-Bulbs-的相关文章

哈理工2015 暑假训练赛 zoj 2976 Light Bulbs

Light BulbsTime Limit:2000MS    Memory Limit:65536KB    64bit IO Format:%lld & %llu SubmitStatusPracticeZOJ 2976 Description Wildleopard had fallen in love with his girlfriend for 20 years. He wanted to end the long match for their love and get marri

zoj 2976 Light Bulbs(暴力枚举)

Light Bulbs Time Limit: 2 Seconds      Memory Limit: 65536 KB Wildleopard had fallen in love with his girlfriend for 20 years. He wanted to end the long match for their love and get married this year. He bought a new house for his family and hired a

LED Turn signal bulbs

Products > chiming new product .T17 bulb power LED .Festoon bulb XPE LED .T10 LED Wedge lamp power 1 LED .T10 LED Wedge bulb power 1 LED .S25 1156 power 28 LED .1156_1157_TH3_LED-Fluorescent_Pink .1156 1157 TH3 LED-Fluorescent Yellow .HB3 HB4 10W FOG

LED Bulbs Turn Signal manufacture

Products > LED Car -Truck bulbs Lights > LED Bulbs Turn Signal light .1156 bulbs-18SMD-LED Bulbs .1156 bulbs-13HP3-LED Bulbs .1156 bulbs-3UHP+LENS-LED Bulbs1156-3UHP-B+LENS1156-3UHP-G+LENS1156-3UHP-R+LENS1156-3UHP-W+LENS1156-3UHP-Y+LENS .1156 bulbs-

LED Brake bulbs Manufacture

Products > LED Car -Truck bulbs Lights .LED Turn signal bulbs Light-3156 .LED Brake bulbs Lights-3157 bulbs .LED Brake bulbs Lights-1157 BAY15D .LED Bulbs Turn Signal light LED Brake bulbs Manufacture

LED Automotive Bulbs Light

Products > chiming new product .T17 bulb power LED .Festoon bulb XPE LED .T10 LED Wedge lamp power 1 LED .T10 LED Wedge bulb power 1 LED .S25 1156 power 28 LED .1156_1157_TH3_LED-Fluorescent_Pink .1156 1157 TH3 LED-Fluorescent Yellow .HB3 HB4 10W FOG

Light bulbs (树状数组模板题)

There are N light bulbs indexed from 00 to N−1. Initially, all of them are off. A FLIP operation switches the state of a contiguous subset of bulbs. FLIP(L, R)means to flip all bulbs x such that L≤x≤R. So for example, FLIP(3, 5) means to flip bulbs 3

2019 ACM-ICPC 上海网络赛 B. Light bulbs (差分)

题目链接:Light bulbs 比赛链接:The Preliminary Contest for ICPC Asia Shanghai 2019 题意 给定 \(N\) 个灯泡 (编号从 \(0\) 到 \(N - 1\)),初始都是关闭的. 给定 \(M\) 个操作,每个操作包含 \(L\) 和 \(R\),对 \([L, R]\) 内的所有灯泡改变状态. 求最后有几个灯泡是亮的. 思路 题目挺简单的,翻转奇数次的灯泡是亮的,所以要求每个灯泡翻转的次数. 容易想到可以用差分. 对所有操作的两

B. Light bulbs(2019 ICPC上海站)

There are NN light bulbs indexed from 00 to N-1N−1. Initially, all of them are off. A FLIP operation switches the state of a contiguous subset of bulbs. FLIP(L, R)FLIP(L,R)means to flip all bulbs xx such that L \leq x \leq RL≤x≤R. So for example, FLI

【上海网络赛】B.Light bulbs

题目描述 There are NN light bulbs indexed from 00 to N-1N−1. Initially, all of them are off. A FLIP operation switches the state of a contiguous subset of bulbs. FLIP(L, R)FLIP(L,R) means to flip all bulbs xx such that L \leq x \leq RL≤x≤R. So for exampl