题目大意:有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. 【深度强化学习】Curriculum-guided Hindsight Experience Replay读后感

    目录 导读 目录 正文 Abstract[摘要] Introduction[介绍] 导读 看任何一个领域的文章,一定要看第一手资料.学习他们的思考方式,论述逻辑,得出一点自己的感悟.因此,通过阅读pa ...

  2. class字节码的结构

    class字节码的结构 使用javap -verbose 命令分析一个.class字节码文件时(以下简称字节码文件),将会分析该字节码文件的魔数,版本号,常量池,类信息,类的构造方法,类中的方法信息, ...

  3. coding++:JS/jQuery获取兄弟姐妹等元素

    jQuery获取: jQuery.parent(expr),找父亲节点,可以传入expr进行过滤,比如$("span").parent()或者$("span") ...

  4. coding++ :Layui-form 表单模块

    虽然对layui比较熟悉了,但是今天有时间还是将layui的form表单模块重新看一下. https://www.layui.com/doc/modules/form.html 1):更新渲染 lay ...

  5. Spring - 数据库开发概述

      Spring 数据库开发 Spring 的 JDBC 模块负责数据库资源管理和镨误处理,大大简化了开发人员对数据库的操作,使得开发人员可以从繁琐的数据库操作中解脱出来,从而将更多的精力投入到编写业 ...

  6. JavaScipt创建函数的方法

    JavaScipt的函数的定义有三种方式:  一.命名函数定义 1.JavaScript 函数通过 function 关键词进行定义,其后是函数名和括号 (). 2.函数名可包含字母.数字.下划线和美 ...

  7. 写给小白看的入门级 Java 基本语法,强烈推荐

    之前写的一篇我去阅读量非常不错,但有一句留言深深地刺痛了我: 培训班学习半年,工作半年,我现在都看不懂你这篇文章,甚至看不下去,对于我来说有点深. 从表面上看,这句话有点讽刺我的文章写得不够通俗易懂的 ...

  8. Django之queryset API

    1. QuerySet 创建对象的方法 >>> from blog.models import Blog >>> b = Blog(name='Beatles Bl ...

  9. 《Three.js 入门指南》2- 照相机

    2.1 什么是照相机 我们使用Three.js创建的场景是三维的,而通常情况下显示屏是二维的,那么三维的场景如何显示到二维的显示屏上呢?照相机就是这样一个抽象,它定义了三维空间到二维屏幕的投影方式,用 ...

  10. jmeter执行多条sql语句

    1.JDBC Connection Configuration 在配置DataBase URL的时候,加上allowMultiQueries=true 2.在JDBC Request中设置Quer T ...