摘要:I. Cockroaches time limit per test6.0 s memory limit per test256 MB inputstandard input outputstandard output There are N cockroaches in the field. Cockroach i is located at coordinate (xi,yi). No tw...
阅读全文
摘要:#include #include #include #include using namespace std; #define ll long long const int N =100009; const ll mod = 1000000007; ll c[N][10]; void init() { c[0][0] =1ll; for...
阅读全文
摘要:试题 E: 迷宫 本题总分:15 分 【问题描述】 下图给出了一个迷宫的平面图,其中标记为 1 的为障碍,标记为 0 的为可 以通行的地方。 010000 000100 001001 110000 迷宫的入口为左上角,出口为右下角,在迷宫中,只能从一个位置走到这 个它的上、下、左、右四个方向之一。 对于上面的迷宫,从入口开始,可以按DRRURRDDDR 的顺序通过迷宫, 一共 10 步。其中 D...
阅读全文
摘要:1 #include 2 using namespace std; 3 #define ll long long 4 const ll inf = 1000000000000; 5 const int N =100010; 6 int n,m; 7 double dp[N]; 8 /* 9 有N个礼物,M次选择,每次取的可能是未被选到的礼物 10 (礼物取走把空盒子放回可...
阅读全文
摘要:#include using namespace std; int main() { srand((unsigned)time(NULL)); //产生的随机数范围是0~65536, for(int i = 0; i < 10;i++ ) cout << rand() << '\n'; cout << endl; ...
阅读全文
摘要:1 #include 2 using namespace std; 3 int n; 4 double d; 5 double p,l,v,ret,sum; 6 int cnt =1; 7 /* 8 9 村庄A,B之间有若干条河流,每条河流上的船速各自保持不变。告诉河流条数,两个村庄之间的距离 10 以及每条河流的距离A村庄的位置,宽度,船的速度。求A...
阅读全文
摘要:1 #include 2 using namespace std; 3 int n,t; 4 const int N = 1200; 5 double dp[N]; 6 /* 7 甩一个n面的骰子,问每一面都被甩到的需要甩的次数期望是多少。 8 dp[i]:已经甩到i个面了,要达到n个面还需要次数的期望 9 显然dp[n] = 0 10 那么逆序分析:dp[i] :再甩一...
阅读全文
摘要:一:Uva12230Crossing Rivers (数学期望)题目大意:有个人每天要去公司上班,每次会经过N条河,家和公司的距离为D,默认在陆地的速度为1,给出N条河的信息,包括起始坐标p,宽度L,以及船的速度v。船会往返在河的两岸,人到达河岸时,船的位置是随机的(往返中)。问说人达到公司所需要的
阅读全文
摘要:#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <map> #include <utility> #include <vector> #in
阅读全文
摘要:1 #include 2 const int N=1000010; 3 int cnt,head[N],n; 4 int size[N],num[N]; 5 void init() 6 { 7 cnt = 0; 8 for(int i =0;i<N;i++) head[i]=-1; 9 } 10 struct Node{ 11 int...
阅读全文
摘要:1 #include 2 using namespace std; 3 #define ll long long 4 const int N = 10000006; 5 ll n,p,r; 6 ll poww(ll a,ll b){ 7 ll ans =1ll; 8 while(b){ 9 if(b&1) ans =ans...
阅读全文
摘要:https://www.jianshu.com/p/9bffbaf12bed 2. 安装MinGW 将MinGW安装在D:\mingw文件夹下(可自由选择,这里为之后添加环境变量作为范例) 安装好后选择需要下载的安装包,选择All packets->MinGW->MinGW Base System-
阅读全文
摘要:L2-029 特立独行的幸福 (25 分) L2-029 特立独行的幸福 (25 分) L2-029 特立独行的幸福 (25 分) 对一个十进制数的各位数字做一次平方和,称作一次迭代。如果一个十进制数能通过若干次迭代得到 1,就称该数为幸福数。1 是一个幸福数。此外,例如 19 经过 1 次迭代得到
阅读全文
摘要:L2-032 彩虹瓶 (25 分) L2-032 彩虹瓶 (25 分) L2-032 彩虹瓶 (25 分) 彩虹瓶的制作过程(并不)是这样的:先把一大批空瓶铺放在装填场地上,然后按照一定的顺序将每种颜色的小球均匀撒到这批瓶子里。 假设彩虹瓶里要按顺序装 N 种颜色的小球(不妨将顺序就编号为 1 到
阅读全文
摘要:#include using namespace std; const int N = 1010; int main(){ char str[256] = { 0 };//str的大小(256)一定要填的。 int data = 1024; /* //将data转换为字符串 sprintf(str,"%d",data); cout #includ...
阅读全文
摘要:L1-064 估值一亿的AI核心代码 (20 分) L1-064 估值一亿的AI核心代码 (20 分) L1-064 估值一亿的AI核心代码 (20 分) 以上图片来自新浪微博。 本题要求你实现一个稍微更值钱一点的 AI 英文问答程序,规则是: 无论用户说什么,首先把对方说的话在一行中原样打印出来;
阅读全文
摘要:判断字符变量c是否为字母或数字,若是则返回非零,否则返回零。
阅读全文
摘要:我们可以发现这三个button并没有将整个屏幕占据,而是根据内容适配大小。 我们在button2里面添加一个属性 android:layout_weight="1" ,发现布局变成这样了: 我们发现这次屏幕被三个button占据了,而且第一个和第三个button还是保持与内容适配大小,而第二个but
阅读全文
摘要:https://blog.csdn.net/weixin_38533896/article/details/81023690 博客里面有安装教程
阅读全文
摘要:1 如果 activity_main.xml没有xml代码可以对图像右键 go to mxl同时可以在design 和 text 切换
阅读全文