zoukankan      html  css  js  c++  java
  • 2020 camp-day6-M

    模拟题

    #include <cstdio>
    #include <vector>
    #include <algorithm>
    
    #define RE register
    #define FOR(i,a,b) for(RE int i=a;i<=b;++i)
    #define ROF(i,a,b) for(RE int i=a;i>=b;--i)
    #define P pair<int,int>
    #define sc(n) scanf("%d",&n)
    
    using namespace std;
    
    const int maxn = 110;
    
    int person[102][12], test[12], wa[102][12], maxwa[102][12];
    int n, m, w, a, b, c;
    long long ans[102];
    
    int main()
    {
        sc(n); sc(m); sc(w);
        FOR(i, 1, w)
        {
            sc(a), sc(b), sc(c);
            if(!person[a][0])person[a][0] = 1;
            if (c)
            {
                if (!person[a][b])++person[a][0],person[a][b] = 1, ++test[b];
                wa[a][b] = 0;
            }
            else ++wa[a][b], maxwa[a][b] = max(maxwa[a][b], wa[a][b]);
        }
        FOR(i, 1, n)
        {
            if (!person[i][0]) { puts("998244353"); continue; }
            if (person[i][0] == 1) { puts("1000000"); continue; }
            if (person[i][0] == m + 1) { puts("0"); continue; }
            else
                FOR(j, 1, m)
                {
                    if (test[j] && !person[i][j])
                        if (test[j] >= n / 2)ans[i] += 30;
                        else ans[i] += 20;
                    if (!person[i][j])ans[i] += 2ll * maxwa[i][j] * maxwa[i][j];
                    else ans[i] += 1ll * maxwa[i][j] * maxwa[i][j];
                }
            printf("%lld
    ", ans[i]);
        }
        return 0;
    }
    

      

  • 相关阅读:
    Python大婶博客汇总
    DevOps之零停机部署
    DevOps之持续交付
    DevOps工具链
    DevOps的概念
    敏捷开发
    自动化运维
    tomcat优化
    java 集合专练
    java匿名内部类,多态,接口练习
  • 原文地址:https://www.cnblogs.com/2aptx4869/p/12216746.html
Copyright © 2011-2022 走看看