Problem L. World Cup
题目大意:有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的更多相关文章
- 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 ...
- 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 ...
- Problem L
Problem Description 在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: L&qu ...
- 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 ...
- 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 ...
- 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 ...
- 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 - ...
- HDU 6330.Problem L. Visual Cube-模拟到上天-输出立方体 (2018 Multi-University Training Contest 3 1012)
6330.Problem L. Visual Cube 这个题就是输出立方体.当时写完怎么都不过,后来输出b<c的情况,发现这里写挫了,判断失误.加了点东西就过了,mdzz... 代码: //1 ...
- 华农oj Problem L: CreatorX背英语【STL】
Problem L: CreatorX背英语 Time Limit: 1 Sec Memory Limit: 64 MB Submit: 53 Solved: 36 [Submit][Status][ ...
随机推荐
- git 分支的创建与合并
首先我们需要先创建一个新的dev分支,然后切换到dev分支: $ git checkout -b dev //命令语句 Switched to a new branch 'dev' //成功执行输出语 ...
- Java——类的定义
对象和类的关系:有一个学生 ,需要在表格上填写自己的信息 ,那么这个打印机就像一个类 ,打印出的表格就是一个对象,用类创建对象,学生填的信息 ,就是我所初始化的信息. 类的组成:由 属性(也叫成员变量 ...
- Jmeter4.0之语言修改(二)
下载最新Jmeter后,解压后,点击jmeter.bat,启动后,界面显示的是英文,那如何切换到中文了,步骤是点击Options中的Choose Language,选择中文 但是关闭Jmeter再次启 ...
- IntelliJ Idea 中文乱码问题
首先,Idea真的是一款很方便的开发工具,但是关于中文乱码这个问题我不得不吐槽,这个编码也弄得这么麻烦干嘛呀...下面就说一下怎么解决中文乱码问题: 1.首先是编辑器的乱码,这个很好解决,file-& ...
- 用pymysql和Flask搭建后端,响应前端POST和GET请求
前言 这次作业不仅需要我建立一个数据库(详情请点击这里),还需要我基于这个数据库写后端接口(注册和登录)供前端访问,接收前端的POST和GET请求,并将登录.注册是否成功传给前端. 本文介绍如何用Fl ...
- 3.用IntelliJ IDEA 创建Maven
一.File→New→ Project (需要下载安装配置Maven等,这些步骤省略) 二.Maven→org.apache.maven.archetypes:maven-archetype-quic ...
- Selenium系列(21) - Cookie操作和源码解读
如果你还想从头学起Selenium,可以看看这个系列的文章哦! https://www.cnblogs.com/poloyy/category/1680176.html 其次,如果你不懂前端基础知识, ...
- JavaScipt创建函数的方法
JavaScipt的函数的定义有三种方式: 一.命名函数定义 1.JavaScript 函数通过 function 关键词进行定义,其后是函数名和括号 (). 2.函数名可包含字母.数字.下划线和美 ...
- UnboundLocalError,探讨Python中的绑定
绑定 将python闭包之前,先梳理一下闭包中的绑定操作. 先看看2个相关的错误 NameError 和UnboundLocalError When a name is not found at al ...
- 使用gulp自动构建项目
网址:https://segmentfault.com/a/1190000011514257