第二题大概这样,没数据测试了 import java.util.*;  public class Main {      private static int count = 0;      public static void main(String[] args) {          Scanner sc = new Scanner(System.in);          int num1= sc.nextInt();          int[] arr=new int [num1];          int key=0;         kk: for (int i = 0; i < num1; i++)                  if(sc.nextInt()==1) {                  arr[key]=sc.nextInt();                  key++;                  }              else {                 int a=0;                  int aa=sc.nextInt();                 for (int j = 0; j < key; j++)                      {                         if((arr[j]|aa)==aa)                             a=a|arr[j];                         if(a==aa)                         {                             System.out.println("YES");                             continue kk;                         }                     }                     System.out.println("NO");                      }          }  
点赞 评论

相关推荐

06-15 20:57
已编辑
门头沟学院 Java
CARLJOSEPH...:年轻人有傲气很正常,但是建议工作前洗净傲气。 说实在的,什么奖学金什么奖项的都很一般。尊重你的老师,在有时间的时候去上课,真遇到走不开的事,请态度端正地向你的老师说明情况,请求请假。我相信任何一个有师德的老师都会允许的(我的老师就是这样)。
点赞 评论 收藏
分享
醉蟀:你不干有的是人干
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务