zoukankan      html  css  js  c++  java
  • HDU 5873 Football Games

    随便判了几个条件就过了,也不知道对不对的。

    正解应该是:

    $[1].$${s_1} + {s_2} + {s_3} + ...... + {s_n} = n(n - 1)$

    $[2].$${s_1} + {s_2} + {s_3} + ...... + {s_i} ≥ i(i - 1)$

    #pragma comment(linker, "/STACK:1024000000,1024000000")
    #include<cstdio>
    #include<cstring>
    #include<cmath>
    #include<algorithm>
    #include<vector>
    #include<map>
    #include<set>
    #include<queue>
    #include<stack>
    #include<iostream>
    using namespace std;
    typedef long long LL;
    const double pi=acos(-1.0),eps=1e-6;
    void File()
    {
        freopen("D:\in.txt","r",stdin);
        freopen("D:\out.txt","w",stdout);
    }
    template <class T>
    inline void read(T &x)
    {
        char c=getchar(); x=0;
        while(!isdigit(c)) c=getchar();
        while(isdigit(c)) {x=x*10+c-'0'; c=getchar();}
    }
    
    const int maxn=200000;
    int T,n,m,sum,a[maxn];
    
    int main()
    {
        while(~scanf("%d",&T))
        {
            while(T--)
            {
                scanf("%d",&n); sum=0; m=0;
                for(int i=1;i<=n;i++) scanf("%d",&a[i]),sum=sum+a[i];
    
                if(sum!=n*(n-1)) { printf("F
    "); continue; }
                
                bool fail=0;
                for(int i=1;i<=n;i++) if(a[i]>2*(n-1)) fail=1;
                if(fail) { printf("F
    "); continue; }
    
                printf("T
    ");
            }
        }
        return 0;
    }
  • 相关阅读:
    php入门到精通(复习笔记)
    MySQL的基础(优化)3
    php之Apache压力测试
    DOS下常用命令
    php连接MySQL分析
    php-memcached详解
    php 四种基本排序算法
    MySQL的基础(优化)2
    SQL入门之集合操作
    SQL入门之多表查询
  • 原文地址:https://www.cnblogs.com/zufezzt/p/5866317.html
Copyright © 2011-2022 走看看