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][ ...
随机推荐
- 图-搜索-DFS-51. N皇后
2020-03-15 19:49:59 问题描述: n 皇后问题研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击. 上图为 8 皇后问题的一种解法. 给定一个整数 n ...
- [并查集+逆向思维]Codeforces Round 722C Destroying Array
Destroying Array time limit per test 1 second memory limit per test 256 megabytes input standard inp ...
- Java集合工具类使用的一些坑,Arrays.asList()、Collection.toArray()、foreach
Arrays.asList() 使用指南 最近使用Arrays.asList()遇到了一些坑,然后在网上看到这篇文章:Java Array to List Examples 感觉挺不错的,但是还不是特 ...
- 为什么要在离线A/B测试中使用贝叶斯方法
当涉及到假设检验时,贝叶斯方法可以取代经典的统计方法.这里将使用web分析的具体案例来演示我们的演示. 贝叶斯方法在经典统计中的重要性在此链接. https://towardsdatascience. ...
- TensorFlow 训练好模型参数的保存和恢复代码
TensorFlow 训练好模型参数的保存和恢复代码,之前就在想模型不应该每次要个结果都要重新训练一遍吧,应该训练一次就可以一直使用吧. TensorFlow 提供了 Saver 类,可以进行保存和恢 ...
- ADO.NET 的使用(二)
一.本篇主要讲ADO.NET的核心DataSet DataSet里面有个DataTable,DataTable还有个对应的DataView 首先呢,假设数据库的数据 id name mob 100 张 ...
- Error response from daemon: rpc error: code = AlreadyExists desc = name conflicts with an existing object: service myweb already exists
主机环境 centos7.2 执行 docker service create --replicas 6 --name myweb -p 80:80 nginx:latest 时 报 Error re ...
- JavaScript 异步、栈、事件循环、任务队列
概览 我们经常会听到引擎和runtime,它们的区别是什么呢? 引擎:解释并编译代码,让它变成能交给机器运行的代码(runnable commands). runtime:就是运行环境,它提供一些对外 ...
- Mac word文档的消失问题以及解决方案
最近用mac电脑上的Microsoft Word写文档时,出现一个很奇怪的现象:明明我已经保存了文档到某个目录下,但是当我退出Word后,准备去保存目录找文档时发现文档消失了,前一秒还在!!! 通过各 ...
- html5 css写出一个实心三角形和空心三角行
原理:css中的border属性的特殊性. 实心三角形: html5: <div id="mydiv"></div> css: #mydiv{ height ...