zoukankan      html  css  js  c++  java
  • hdu 3744 A Runing Game 菜鸟杯

    http://acm.hdu.edu.cn/showproblem.php?pid=3744

    #include<stdio.h>
    #include<stdlib.h>
    main()
    {
          long  i,j,flag,t,m,n;
          scanf("%ld",&t);
         
          struct stud
          {
                 long a,b;
          }p[300];
          while(t--)
          {
            scanf("%ld%ld",&n,&m);
            for(i=1;i<=n;i++)
            scanf("%ld%ld",&p[i].a,&p[i].b);
            for(i=1;i<n;i++)
            {
               flag=0;
               for(j=n;j>=i+1;j--)
                  if(p[j].b<p[j-1].b)
                  {
                    p[0]=p[j];p[j]=p[j-1];p[j-1]=p[0];
                    flag=1;
                  }
                  if(!flag)
                  break;
           }
           int x=0,y=0;
           for(i=n;i>=2;i--)
           {
               if(p[i].a>p[i-1].a)
                 x++;
           }
           if(x*400>=m)
           {
             printf("NO\n");
           }
           else
             printf("YES\n");
         
       }
         // system("pause");
    }

  • 相关阅读:
    golang单例模式
    PHP打开并修改文件
    关于文件服设计的一些想法
    Api
    golang Iterate through the fields of a struct in Go
    zookeeper note
    centos 6 install protoc
    todo
    linux route
    build http_load
  • 原文地址:https://www.cnblogs.com/zxj015/p/2740263.html
Copyright © 2011-2022 走看看