解题思路:

暴力绝对TLE

一个队伍穿主场球衣的次数 = 这个队伍的客场球衣颜色与其他队主场球衣颜色起冲突的次数 + (n - 1)

#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
const int MAXSIZE = ;
const int INF = 0x3f3f3f3f; int a[], b[], c[], cnt[];
int main(){
int t, i, j, m, n;
memset(c, , sizeof(c));
memset(cnt, , sizeof(cnt));
scanf("%d",&n);
for(i = ; i <= n; ++i){
scanf("%d%d",&a[i],&b[i]);
++cnt[a[i]];
}
for(i = ; i <= n; ++i){
c[i] += n - ;
c[i] += cnt[b[i]];
}
int temp = (n - ) * ;
for(i = ; i <= n; ++i){
printf("%d %d\n",c[i],temp - c[i]);
}
return ;
}

432B - Football Kit的更多相关文章

  1. CodeForces 432B Football Kit

     Football Kit Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Subm ...

  2. CF 432B :Football Kit

    hash做法: #include<stdio.h> #include<string.h> ; int home[Max],away[Max],hash[Max]; int ma ...

  3. Codeforces Round #246 (Div. 2) —B. Football Kit

    B. Football Kit time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  4. Codeforces Round #246 (Div. 2) B. Football Kit

    题目的意思是求出每个队穿主场衣服和客场衣服的次数 每个队作为主场的次数是n-1,作为客场的次数是n-1 当每个队打主场的时候肯定穿的主场衣服 当每个队打客场时,如果客场与主场的衣服不同,则穿客场衣服 ...

  5. codeforces 432 B Football Kit

    题意:给出n支球队,主场的衣服的颜色x[i],客场的衣服的颜色y[i],每只队伍会打n-1次主场,n-1次客场,当这只队伍打客场的衣服颜色和对手一样的时候,那么他们要穿上主场的衣服 问每个球队主场球服 ...

  6. CODEFORCE 246 Div.2 B题

    题目例如以下: B. Football Kit time limit per test 1 second memory limit per test 256 megabytes input stand ...

  7. Spartan Exploit Kit分析

    之前都是调试flash的漏洞,相关的样本接触较少,碰巧看到一篇不错的分析,尝试了一下,留个记录. 调试flasher样本一般建议使用调试版的flash player,在调试版本下可以输出swf文件运行 ...

  8. Microsoft IoT Starter Kit 开发初体验

    1. 引子 今年6月底,在上海举办的中国国际物联网大会上,微软中国面向中国物联网社区推出了Microsoft IoT Starter Kit ,并且免费开放1000套的申请.申请地址为:http:// ...

  9. SuiteScript > Apply script to Assembly and Kit

    Path: Customization > Scripting > Scripts > New Limitation: Client script can't apply to As ...

随机推荐

  1. [LeetCode]题解(python):106-Construct Binary Tree from Inorder and Postorder Traversal

    题目来源: https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/ 题意分析 ...

  2. ssh远程登录linux服务器

    ssh远程登录linux服务器 用法: ssh -l user -p port server_ip 或者 ssh -p port user@server_ip 参数: -l 后接要登录的远程系统用户名 ...

  3. windows文件快速搜索软件推荐

    everything文件搜索工具,可以快速搜索windows下的文件

  4. 射频识别技术漫谈(27)——CPU卡概述

    智能卡按安全级别可以分为三类:存储器卡.逻辑加密卡和CPU卡,其中CPU卡是安全级别最高的.从“CPU”这个名字可以看出,CPU卡最大的特点就是卡片里面有一个"CPU",有了CPU ...

  5. iOS键盘遮挡问题解决办法

    iOS开发之“键盘遮挡输入框的解决办法”之一 -----键盘通知之前处理这种问题,总是在触发输入框编辑事件键盘弹出的时候,将当前的View整体向上移动,结束编辑又整体向下移,耗时耗力效率低. 在网上看 ...

  6. Special Subsequence(离散化线段树+dp)

    Special Subsequence Time Limit: 5 Seconds      Memory Limit: 32768 KB There a sequence S with n inte ...

  7. 定制ToolChain for ARM

    **************************************************************************编写:王卫无,北京讯业互联科技有限公司版本号:V1. ...

  8. python 之 yield表达式

    如果在某个函数中包含了yield, 这意味着这个函数已经是一个Generator, 它的执行 会和其他普通的函数有很多不同. 比如: def   h(): print    'To   be  bra ...

  9. URL中含有+号,出现错误“请求筛选模块被配置为拒绝包含双重转义序列的请求”的解决方法

    搜索关键词中含空格,提交后被自动转成了“+”号,报如下错误: HTTP 错误 404.11 - Not Found 请求筛选模块被配置为拒绝包含双重转义序列的请求. 解决方法: 在web.config ...

  10. 用nodejs安装hexo,将hexo部署到github

    跌跌撞撞写这篇博文,希望下一篇可以好点 运行环境:最新版本的nodejs + git 安装好nodejs 和 git ,注册好github账号,新建仓库****.github.io(****为gith ...