题目大意:有A,B,C,D四个队伍,两两之间有一个比赛,假如A和B比赛,如果平局,各加一分,如果说A胜,给A加3分,不给B加分,B胜同理

给出A,B,C,D,的得分,判断形成这种局面有多少种方式。

思路 DFS,,枚举每3种情况,赢输平局。

#include<bits/stdc++.h>
using namespace std;
int d[][]={{,},{,},{,},{,},{,},{,}};
int t[][][][] ;
int arr[+];
void dfs(int x){
if(x==) {
t[arr[]][arr[]][arr[]][arr[]]++;
return ;
}
for(int i=;i<=;i++){
if(i==){
arr[d[x][]]++;
arr[d[x][]]++;
dfs(x+);
arr[d[x][]]--;
arr[d[x][]]--;
} else if(i==){
arr[d[x][]]+=;
dfs(x+);
arr[d[x][]]-=;
}
else {
arr[d[x][]]+=;
dfs(x+);
arr[d[x][]]-=;
}
}
} void solve(int xx){
int a,b,c,d;
cin>>a>>b>>c>>d;
printf("Case #%d: ",xx);
if(a>=||b>=||c>=||d>=) puts("Wrong Scoreboard");
else if(t[a][b][c][d]==) puts("Yes");
else if(t[a][b][c][d]==) puts("Wrong Scoreboard");
else puts("No");
}
int main(){
dfs();
int t;
cin>>t;
for(int i=;i<=t;i++) solve(i);
return ;
}

Problem L. World Cup的更多相关文章

  1. XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem L. Canonical duel

    题目:Problem L. Canonical duelInput file: standard inputOutput file: standard outputTime limit: 2 seco ...

  2. The Ninth Hunan Collegiate Programming Contest (2013) Problem L

    Problem L Last Blood In many programming contests, special prizes are given to teams who solved a pa ...

  3. Problem L

    Problem Description 在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: L&qu ...

  4. Gym 102056L - Eventual … Journey - [分类讨论][The 2018 ICPC Asia-East Continent Final Problem L]

    题目链接:https://codeforces.com/gym/102056/problem/L LCR is really an incredible being. Thinking so, sit ...

  5. 2013-2014 ACM-ICPC, NEERC, Southern Subregional Contest Problem L. Stock Trading Robot 水题

    Problem L. Stock Trading Robot 题目连接: http://www.codeforces.com/gym/100253 Description CyberTrader is ...

  6. 2018 Multi-University Training Contest 4 Problem L. Graph Theory Homework 【YY】

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6343 Problem L. Graph Theory Homework Time Limit: 2000 ...

  7. HDU 6343.Problem L. Graph Theory Homework-数学 (2018 Multi-University Training Contest 4 1012)

    6343.Problem L. Graph Theory Homework 官方题解: 一篇写的很好的博客: HDU 6343 - Problem L. Graph Theory Homework - ...

  8. HDU 6330.Problem L. Visual Cube-模拟到上天-输出立方体 (2018 Multi-University Training Contest 3 1012)

    6330.Problem L. Visual Cube 这个题就是输出立方体.当时写完怎么都不过,后来输出b<c的情况,发现这里写挫了,判断失误.加了点东西就过了,mdzz... 代码: //1 ...

  9. 华农oj Problem L: CreatorX背英语【STL】

    Problem L: CreatorX背英语 Time Limit: 1 Sec Memory Limit: 64 MB Submit: 53 Solved: 36 [Submit][Status][ ...

随机推荐

  1. 洛谷 P2257 YY的GCD 题解

    原题链接 庆祝: 数论紫题 \(T4\) 达成! 莫比乌斯 \(T1\) 达成! yy 真是个 神犇 前记 之前我觉得: 推式子,直接欧拉筛,筛出个 \(\phi\),然后乱推 \(\gcd\) 就行 ...

  2. Java导出Excel文件

    /** * 导出 用get请求 * @param response * @param * @throws IOException */ @RequestMapping(value = "/d ...

  3. OSLab:实模式与保护模式

    日期:2019/5/18 12:00 内容:操作系统实验作业:x86:IA-32:实模式与保护模式. PS:如果我们上的是同一门课,有借鉴代码的铁汁请留言告知嗷.只是作业笔记,不推荐学习. 一.实模式 ...

  4. PHP一致性hash

    PHP提供了两种比较两个变量的方法: 松散比较使用 == or != : 两个变量都具有“相同的值”. 严格比较 === or !== : 两个变量都具有“相同的类型和相同的值”. 类型杂耍 真实陈述 ...

  5. coding++:SpringBoot 处理前台字符串日期自动转换成后台date类型的三种办法

    第(1)种: 使用@DateTimeFormat(pattern = “yyyy-MM-dd HH:mm:ss”)注解在实体字段上. 这种方式的优点是:可以灵活的定义接收的类型 缺点很明显:不能全局统 ...

  6. NatApp 外网映射工具

    外网映射工具 在做微信开发或者是对接第三方支付接口时,回调接口可能需要外网访问,这时候开发者在本地测试的时候,需要用到外网测试工具.常用的外网测试工具有natapp.ngrok NatApp简介服务器 ...

  7. [codevs2370]小机房的树<LCA>

    题目链接:http://codevs.cn/problem/2370/ 这题我还是做了比较久了,因为有人告诉我这是用tarjan离线做 好吧算我是蒟蒻,真心不懂tarjan怎么做,最后还是用倍增做的 ...

  8. CodeForces 190C STL

    Portal: http://codeforces.com/problemset/problem/190/C 一道卡输入输出的蛋疼题 题意:给你一个由pair和int所组成的沙茶字符串(最大含有1e5 ...

  9. docker 搭建keepalived+nginx高可用

    前言 最近工作 中 有用到keepalived,就想着 在 本地 搭建一套环境验证一下相关的功能.因为创建虚拟机比较麻烦,就借助  docker来搭建这样 一套 环境 ,顺带学习 巩固下docker的 ...

  10. 201771010108-韩腊梅 实验一 软件工程准备—<对软件工程的初步了解>

    项目 内容 课程班级博客链接 https://edu.cnblogs.com/campus/xbsf/nwnu2020SE 这个作业要求链接 https://www.cnblogs.com/nwnu- ...