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,…
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…
用扩展KMP做简单省力..... D. Prefixes and Suffixes time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character.…
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…
思维加枚举 题意 :足球赛,赢平所得到的分数分别为w和d,w>d,分别求赢平输的场数,输出一组即可,即x+y+z=n 且 xw+yd=p的一组解. 可以扩展公约数做,但由于注意到d和w<1e5的条件,可以枚举. 个人理解是由于dw=wd 就是说你用w场平的所得分和d场赢所得分是一样,所以我们就可以调整平的场数,由于题目有这样一句话 Note that w>dw>d, so the number of points awarded for winning is strictly gr…
题目例如以下: 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…