B Breaking Branches 题意:两个人比赛折枝,谁剩下最后1,无法折出整数即为输 思路:树枝长n,若是奇数,则Bob胜出,若是偶数,则Alice胜出,且需要输出1: 1 #include<stdio.h> 2 int main(){ 3 int n; 4 scanf("%d",&n); 5 if(n%2==0){ 6 printf("Alice\n"); 7 printf("1\n"); 8 }else{ 9 p…
题目链接如下: https://nanti.jisuanke.com/t/43321 思路: 显然我们要采用二分的方法来寻找答案,给定一个高度如果能确定在这个高度时是否可以安全到达终点,那我们就可以很快二分出最大可行的高度.在判断一个高度是否可行时,搜索从起点开始,在限制的高度下所有可以到达的坐标位置,检验是否经过终点即可. /************************************************ ┆ ┏┓ ┏┓ ┆ ┆┏┛┻━━━┛┻┓ ┆ ┆┃ ┃ ┆ ┆┃ ━ ┃…
A. Majestic 10 题意:三个数均大于10则输出"triple-double",如果两个数大于10则输出"double-double",如果一个大于10则输出"double",如果没有数大于10则输出"zilch" #include<stdio.h> int main(){ int n,a,b,c; scanf("%d",&n); while(n--){ scanf("…
A.Electric Bill 题意:简单计算题,超过1000部分额外算 1 #include<stdio.h> 2 int main(){ 3 int money1,money2; 4 long long int sum=0,n,num; 5 scanf("%d %d",&money1,&money2); 6 scanf("%lld",&n); 7 while(n--){ 8 sum=0; 9 scanf("%lld&…
A.Majestic 10 签到题. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cmath> #include<cstdlib> #include<ctime>…
原文链接https://www.cnblogs.com/zhouzhendong/p/AtCoder-SoundHound-Inc-Programming-Contest-2018-E.html 题目传送门 - AtCoder SoundHound Inc. Programming Contest 2018 E 题意 给定一个无向连通图,有 $n$ 个节点 $m$ 条带权边,第 $i$ 条边连接 $x_i,y_i$ ,权值为 $s_i$ ,没有重边.自环. 现在,请你给每一个节点取一个正整数点权…
ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syria, Lattakia, Tishreen University, April, 30, 2018 Problem A. Can Shahhoud Solve it? Problem B. Defeat the Monsters Problem C. UCL Game Night Problem…
Battle Royale games are the current trend in video games and Gamers Concealed Punching Circles (GCPC) is the most popular game of them all. The game takes place in an area that, for the sake of simplicity, can be thought of as a two-dimensional plane…
A family of nn gnomes likes to line up for a group picture. Each gnome can be uniquely identified by a number 1..n1..n written on their hat. Suppose there are 55 gnomes. The gnomes could line up like so: 1, 3, 4, 2, 51,3,4,2,5. Now, an evil magician…
Consider an n \times mn×m matrix of ones and zeros. For example, this 4 \times 44×4: \displaystyle \begin{matrix} 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 1 \\ 0 & 1 & 1 & 1 \\ 0 & 1 & 1 & 0 \end{matrix}1000​1111​1111​1…