ProblemA
Description One rainy gloomy evening when all modules hid in the nearbycafes to drink hot energetic cocktails, the Hexadecimal virusdecided to fly over the Mainframe to look for a Great Idea. And shehas found one! Why not make her own Codeforces, with blackjack and other reallycool stuff? Many people will surely be willing to visit thissplendid shrine of high culture. In Mainframe a standard pack of The player has already got the first card, it's the queen ofspades. To evaluate chances for victory, you should determine howmany ways there are to get the second card so that the sum ofpoints exactly equals Input The only line contains Output Print the numbers of ways to get the second card in the requiredway if the first card is the queen of spades. Sample Input
Input
12
Output
4
Input
20
Output
15
Input
10
Output
0 Hint In the first sample only four two's of different suits can earnthe required sum of points. In the second sample we can use all tens, jacks, queens andkings; overall it's In the third sample there is no card, that would add a zero tothe current ten point
代码:
#include<iostream>
#include<stdio.h>
#include<cmath>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
if(n==21){printf("4\n");continue;}
if(n<=10||n>20)
printf("0\n");
if(n>10&&n<20)
printf("4\n");
if(n==20)
printf("15\n");
}
return 0;
}
|
相关推荐
chrome缓存清理神器
chrome缓存清理神器,打开chrome的‘更多工具’->‘扩展程序’页面,然后把这个文件拖进去即可,然后点击右上角出现的圈图标便可一键清缓存,谁用谁知道
【HNUOJ】2822. Blackjack
2822. Blackjack time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output One rainy gloomy evening when all modules hid in the nearby cafes to drink hot energetic cocktails, the Hexadecimal virus decided
VLC Media Player for Linux 3.0.2 正式版
Linux 版 VLC Media Player,支持所有视频格式,多媒体流rtsp\rtmp\hls
codeforces104A
Blackjack CodeForces - 104A Tensor特别喜欢玩扑克,还总是爱发明一些关于扑克牌的游戏,有天他突然脑洞大开想到了这样的一个游戏: 现在有一副52张的扑克牌(没有大小王),规定每一张牌都有他自己的values,2~10点数分别对应2~10的values,QJK代表的values都是10,A代表的点数是1或者11。现在游戏的参与者手中已经有一张黑桃10。 Te...
新手必看:Infineon Memtools烧录配置全流程(附常见错误解决方案)
本文为嵌入式开发新手提供了Infineon AURIX开发环境搭建与Memtools烧录的全流程实战指南。详细解析了ADS、DAS和Memtools三大核心工具的角色与协同关系,并重点讲解了Memtools的图形界面配置步骤、烧录操作流程,以及针对“无法连接设备”、“编程失败”等常见错误的系统性排查与解决方案,帮助开发者快速上手并规避典型陷阱。
虚幻UE 增强输入-触发器
输入触发器(UInputTrigger): 使用经过修饰器修改的输入值,或者使用其他输入动作的输出值,来确定是否激活输入动作。
Educational Codeforces Round 104 (Rated for Div. 2)A-E题解
Educational Codeforces Round 104 (Rated for Div. 2)A-E题解 比赛链接:https://codeforces.ml/contest/1487 A题 简单结论,暴力 A的题意一开始没讲清楚,光看了前两组样例也没发现不对,等敲完代码了才看见第三组样例。出了个公告澄清题意后直接秒掉。花了10分钟血亏。 题意: 给定n个英雄(n最大为100),每个英雄一开始都有他自己的等级(1到100)。现在你要安排这些英雄按照一定顺序进行一对一的对决,每一个人可以被任意选择进行
Verilog——反相器
反相器代码: module inv( A, Y );//A,Y是端口 //定义端口属性 input A; output Y; //定义输入输出关系 assign Y=~A;//Y等于A的反 endmodule //inv是module的名字
Codeforces 104A Blackjack
题意: 有2, 3, 4, 5, 6, 7, 8, 9, 10, jacks,queens,kings,aces这13种牌各4张不同的花色,现给出2~10能获得的点数为2~10和 jacks,queens,kings能获得的点数都为10,aces能获得的点数为1或者11。现在你有第一张牌为黑桃10,给出n 思路: 就25,在纸上写写就好了。 #include int main(){ i
细胞膜电学特性的分数阶微积分建模
分数阶微积分在细胞膜电学特性建模中的应用主要体现在对细胞膜的电容行为和神经元放电活动的更精确描述上。
Ambari 3.0.0 + BigTop 3.3.0 源码编译与集群部署指南(Kylin V10 / aarch64)
仅仅是针对“应用商店目录(Applications Catalog)”的一个外围附属子模块(它不是 YARN 监控大盘,不影响 YARN UI 网页的主体使用),我们可以采用。自带的 Node 二进制是 x86_64 版本,在 ARM64(aarch64)容器上无法执行(Exit value: 126)。:Ambari Server/Agent 使用 JDK 17,BigTop 大数据组件(Hadoop/HBase/Spark 等)使用 JDK 8。,源码中包含 x86 特定的原生二进制文件。
Educational Codeforces Round 104 (Rated for Div. 2) A,B,C,D,E
Educational Codeforces Round 104 (Rated for Div. 2) A,B,C,D,E A - Arena 题意 nnn 个英雄,他们的等级分别是 a1,a2,…,ana_1,a_2,…,a_na1,a2,…,an ,和同等级的英雄打会平局,和比自己等级低的打可以使自己等级上升 111 ,两个英雄可以打很多次。我们称可能可以达到 100500100^{500}100500 的英雄成为可能的冠军,问有多少个可能的冠军? 思路 只要有比自己等级低的英雄,就可能是冠军。
数据结构(超详细讲解!!)第十七节 队列应用(杨辉三角)
杨辉三角
Educational Codeforces Round 104(A-E题解)
我昨天打了一下Educational Codeforces Round 104的比赛,场内做出了A,B,C,D,E五题,这场的C,D比以往简单。 A. Arena 思路:直接找最小值出现的次数即可。 #pragma GCC optimize("-Ofast","-funroll-all-loops") #pragma GCC optimize(2) #pragma GCC optimize(3,"Ofast","inline") #include<bits/stdc++.h> using nam
Cesium+Vue3教程(003):基于Vue3的Cesium自定义地图和地图叠加
在 Cesium 中,是用于加载地表影像图层的核心接口。通过它,您可以将各种地图服务(如卫星影像、街道地图、自定义瓦片等)加载到 Cesium 的地球上。Cesium 提供了多个内置的。
Android Jetpack 最全面试题及参考答案
要使用 WorkManager 定义一个异步任务,以下是详细步骤。首先,需要创建一个继承自 Worker 类的自定义类,这个类代表了要执行的具体任务逻辑。// 在这里编写具体的任务逻辑,比如从网络下载文件try {在上述代码中,doWork方法就是任务的核心执行逻辑所在,这里模拟了从给定的 URL 下载文件到本地的操作,若下载成功返回,若出现异常则返回。然后,在需要调度任务的地方,比如在某个 Activity 或者 Fragment 中,通过构建 WorkRequest 来安排任务执行。
Educational Codeforces Round 104 A-D
文章目录A-ArenaB-Cat CycleC-Minimum TiesD-Pythagorean Triples A-Arena 题目大意:有n个英雄,英雄之间会不断发生战斗,等级高的英雄会赢。求最后可以赢到100的500次方的英雄数量 思路:战斗不断进行没有条件限制,那么只要这个英雄可以打得过任何一个人那么只要时间不限他就可以完成胜利的场次数量。换句话书,只有有人比他弱就可以,所以答案就是总数减去等级最低的那一批人的数量。 AC代码: #include <iostream> #includ
怀旧版电脑GBC模拟器
再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。
CodeForces - 650A(104/600)
Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi,
Probability and Statistics - 4th edition
Probability and Statistics - 4th edition
Statistics and Machine Learning Toolbox
Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具
Educational Codeforces Round 104 (Rated for Div. 2)1487A
原题 原题链接 题意 有n个勇者,任意两个勇者可以进行战斗,等级高的获胜,等级相等则没有人获胜,且每获胜一次等级加一;问最后可能会有多少勇者可能会胜出; 思路 只需记录等级大于等级最小的勇者的个数即可; AC代码 #include<iostream> #include<algorithm> using namespace std ; int main() { int t ; cin >> t ; while( t -- ) { int
jdk-8u144-linux-x64.tar.gz.
该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包
CF 104A.Blackjack
题目:http://icpc.njust.edu.cn/Problem/CF/104A/ AC代码(C++): #include #include #include #include #include #include #include #include #define INF 0x3f3f3f3f #define eps 1e-8 typedef unsigne
Educational Codeforces Round 104 (Rated for Div. 2) A-E 题解
A. Arena 介绍了一下博弈的规则 我们发现只有从顺序第二个不同的数的人开始 有机会获胜 因为他可以不断找比自己积分少的人单挑 #include<cstdio> #include<iostream> #include<vector> #include<map> #include<set> #include<stack> #include<algorithm> #include<cstring> #includ
Educational Codeforces Round 104 (Rated for Div. 2) 题解
Educational Codeforces Round 104 (Rated for Div. 2) A. Arena int a[maxn]; int main() { ios; int t; cin >> t; while (t--) { int n; cin >> n; int minn=inf; for(int i=1;i<=n;i++) { cin >> a[i]; minn=min(minn,a[i]);} int ans=
Educational Codeforces Round 104 (Rated for Div. 2)(A B C D E F)
题目链接https://codeforces.com/contest/1487 目录A- ArenaB- Cat CycleC- Minimum TiesD- Pythagorean TriplesE- Cheap DinnerF- Ones A- Arena 题目:有n个有等级英雄,和同等级的英雄打会平局,和比自己等级低的打可以使自己等级上升1,两个英雄可以打很多次。称可以达到100500100^{500}100500的英雄可以成为冠军,问有多少个可能的冠军 思路:比最小值大就可以。 代码: #inclu
Codeforces Round #104 (Div. 2)---A. Lucky Ticket
A. Lucky Ticket time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Petya loves lucky numbers very much. Everyb
Educational Codeforces Round 104 (Rated for Div. 2) A B C D E
题解传送门
Educational Codeforces Round 104 (Rated for Div. 2)
文章目录Educational Codeforces Round 104 (Rated for Div. 2)A. ArenaB. Cat CycleC. Minimum TiesD. Pythagorean TriplesE. Cheap Dinner Educational Codeforces Round 104 (Rated for Div. 2) A. Arena 题意: n个英雄,每个英雄有一个权值,权值大的能够赢权值小的,只要一个英雄能够赢一场,那么这个英雄就可以当赢家,问有多少个英雄不能当赢
276




被折叠的 条评论
为什么被折叠?



