FZU 2147 A-B Game(数学)】的更多相关文章

我们只需要知道这个取完模最大是 a / 2 + 1就可以了,不过超时了几次,换了visual C++才过,oj还真是傲娇啊. #include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { int t; long long a,b; ; scanf("%d",&t); while(t--) { scanf("%lld %l…
A-B Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice FZU 2147 Description Fat brother and Maze are playing a kind of special (hentai) game by two integers A and B. First Fat brother write an int…
主要思路:求出蚊子到达球的时间区间(用方程得解),对区间做一个贪心的选择,选择尽可能多的区间有交集的区间段(结构体排序即可),然后计数. #include <cstdio> #include <cmath> #include <iostream> #include <algorithm> using namespace std; #define ll long long #define maxn 100025 int n, m, x,y; ll r; int…
 FZU 2110  Star Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u  Practice Description Overpower often go to the playground with classmates. They play and chat on the playground. One day, there are a lot of stars in the sk…
题目传送门 /* 数学:假设取了第i个,有C(n-1)(i-1)种取法 则ans = sum (C(n-1)(i-1)) (1<i<=n) 即2^(n-1) */ #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; typedef long long ll; ; const int INF = 0x3f3f3…
现在有一个等式如下:x^2+s(x,m)x-n=0.其中s(x,m)表示把x写成m进制时,每个位数相加的和.现在,在给定n,m的情况下,求出满足等式的最小的正整数x.如果不存在,请输出-1. Input 有T组测试数据.以下有T(T<=100)行,每行代表一组测试数据.每个测试数据有n(1<=n<=10^18),m(2<=m<=16). Output 输出T行,有1个数字,满足等式的最小的正整数x.如果不存在,请输出-1. Sample Input 4 4 10 110 10…
Yinyangshi is a famous RPG game on mobile phones. Kim enjoys collecting cards in this game. Suppose there are n kinds of cards. If you want to get a new card, you need to pay W coins to draw a card. Each time you can only draw one card, all the cards…
Yinyangshi is a famous RPG game on mobile phones. Kim enjoys collecting cards in this game. Suppose there are n kinds of cards. If you want to get a new card, you need to pay W coins to draw a card. Each time you can only draw one card, all the cards…
Problem Description 题目描述 ZB loves watching RunningMan! There's a game in RunningMan called 100 vs 100. There are two teams, each of many people. There are 3 rounds of fighting, in each round the two teams send some people to fight. In each round, whi…
题目链接:http://acm.fzu.edu.cn/problem.php?pid=2232 Description GG学长虽然并不打炉石传说,但是由于题面需要他便学会了打炉石传说.但是传统的炉石传说对于刚入门的GG学长来说有点复杂,所以他决定自己开发一个简化版的炉石传说. 在简化版的炉石传说中: 每个随从只有生命值和攻击力,并且在你的回合下,你的每只随从在本回合下只能选择一个敌方随从进行攻击.当两个随从a,b交战时,a的生命值将减去b的攻击力,b的生命值将减去a的攻击力,(两个伤害没有先后…