
数学
永夜莫明
菜是原罪
展开
-
猜数游戏
链接:https://www.nowcoder.com/questionTerminal/0a5b316cfe9d4c4ba89c6c57a1ee516e来源:牛客网牛牛和羊羊在玩一个有趣的猜数游戏。在这个游戏中,牛牛玩家选择一个正整数,羊羊根据已给的提示猜这个数字。第i个提示是"Y"或者"N",表示牛牛选择的数是否是i的倍数。例如,如果提示是"YYNYY",它表示这个数使1,2,4,5的倍数,但不是3的倍数。注意到一些提示会出现错误。例如: 提示"NYYY"是错误的,因为所有的整数都是1的倍数,所原创 2020-05-22 13:20:49 · 351 阅读 · 0 评论 -
Number of Containers(数论?数学!其实就是个分块裸题)
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3175For two integersmandk,kis said to be a container ofmifkis divisible bym. Given 2 positive integersnandm(m<n), the ...原创 2019-03-20 12:59:45 · 350 阅读 · 0 评论 -
幂一矩阵
题解https://blog.youkuaiyun.com/qq_26358509/article/details/71056436C++代码(60%)#include<cstdio>#include<iostream>#include<algorithm>#include<map>using namespace std;typedef ...原创 2019-05-23 20:16:17 · 302 阅读 · 0 评论 -
求整数的二进制里有多少个1
求整数的二进制里有多少个1https://blog.youkuaiyun.com/m0_38121874/article/details/80139608链接:https://ac.nowcoder.com/acm/contest/908/C来源:牛客网时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld...原创 2019-06-01 23:38:34 · 232 阅读 · 0 评论 -
Just Random(思维+数学找规律+容斥)
题目链接:https://cn.vjudge.net/problem/HDU-4790Coach Pang and Uncle Yang both love numbers. Every morning they play a game with number together. In each game the following will be done: 1. Coach Pang ...原创 2019-07-02 16:56:11 · 562 阅读 · 0 评论 -
ABBA(组合数学/dp)
链接:https://ac.nowcoder.com/acm/contest/881/E来源:牛客网Bobo has a string of length 2(n + m) which consists of characters `A` and `B`. The string also has a fascinating property: it can be decomposed i...原创 2019-07-19 14:15:21 · 629 阅读 · 2 评论 -
Integration(定积分)
链接:https://ac.nowcoder.com/acm/contest/881/B来源:牛客网裂项,化乘为加以此类推#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<string>#...原创 2019-07-19 15:38:41 · 894 阅读 · 0 评论 -
无聊游戏(博弈+思维+数学推导+模糊模拟)
问题 B: 无聊游戏问题 B: 无聊游戏时间限制: 1 Sec内存限制: 128 MB提交: 96解决: 18[提交] [状态] [命题人:admin]题目描述小N和小A在玩这样的一个游戏:给定初始数列Q,小N先把某个前缀(可以为空)的数字全部乘上−A,小A再把某个后缀(可以为空)的数字全部乘上−B,小N想让最后所有数的和尽量大,而小A想让最后所有数的和尽量的小。...原创 2019-07-31 19:48:27 · 324 阅读 · 0 评论