CodeForces 432B Football Kit】的更多相关文章

 Football Kit Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 432B Description Consider a football tournament where n teams participate. Each team has two football kits: for home games,…
解题思路: 暴力绝对TLE 一个队伍穿主场球衣的次数 = 这个队伍的客场球衣颜色与其他队主场球衣颜色起冲突的次数 + (n - 1) #include <stdio.h> #include <string.h> #include <iostream> using namespace std; ; const int INF = 0x3f3f3f3f; ], b[], c[], cnt[]; int main(){ int t, i, j, m, n; memset(c,…
hash做法: #include<stdio.h> #include<string.h> ; int home[Max],away[Max],hash[Max]; int main() { int n,sum,total; int i,j; while(scanf("%d",&n)!=EOF) { sum = ; total = *(n-); ;i<n;i++) scanf("%d %d",&home[i],&a…
B. Football Kit time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Consider a football tournament where n teams participate. Each team has two football kits: for home games, and for away games…
题目的意思是求出每个队穿主场衣服和客场衣服的次数 每个队作为主场的次数是n-1,作为客场的次数是n-1 当每个队打主场的时候肯定穿的主场衣服 当每个队打客场时,如果客场与主场的衣服不同,则穿客场衣服   如果客场与主场的衣服相同,则穿主场衣服 则只需要标记主场每种衣服有多少球队,当作为客场时查找与客场颜色相同的主场球队有多少即可 #include <iostream> #include <map> #include <vector> #include <algor…
题意:给出n支球队,主场的衣服的颜色x[i],客场的衣服的颜色y[i],每只队伍会打n-1次主场,n-1次客场,当这只队伍打客场的衣服颜色和对手一样的时候,那么他们要穿上主场的衣服 问每个球队主场球服和客场球服分别穿了多少次 主场分两部分 1.本来n-1场穿的 2.打客场的时候和对手一样穿上主场的衣服 所以统计一下主场的每种颜色对应的衣服有多少件 那么对应于一只球队(x[i],y[i]) 就是n-1+home[y[i]],n-1-home[y[i]] 题意好绕的说啊-----5555555555…
题目例如以下: B. Football Kit time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Consider a football tournament where n teams participate. Each team has two football kits: for home games, and for aw…
A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has started watching football games. He has learned that for some fouls the players receive yellow cards, and for some fouls they receive red cards. A player wh…
地址:http://codeforces.com/contest/782/problem/D 题目: D. Innokenty and a Football League time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Innokenty is a president of a new football league in B…
题目链接:http://codeforces.com/contest/493/problem/A 题目意思:给出两个字符串,分别代表 home 和 away.然后有 t 个player,每个player偶四个属性描述:分钟,所属的队名(即上面的两个字符串的其中一个),该player的num,得到的card颜色(y/r). 当一个人得到两个y card 时会自动转为 r card.最终需要按时间先后的顺序输出player第一次获得red card 的时间. 由于数据是按时间先后顺序排列的,那么对于…