上一页 1 ··· 29 30 31 32 33
摘要: [https://vjudge.net/contest/220165 problem/D] include include using namespace std; define maxn 1010 int main(){ int n,a[maxn],b[maxn]; int kase=0; whi 阅读全文
posted @ 2018-07-30 17:31 ChunhaoMo 阅读(127) 评论(0) 推荐(0) 编辑
摘要: ``` include using namespace std; define maxn 100 int a[maxn][maxn]; int main(){ int n,tot,i,x,y; while(cin n){ memset(a,0,sizeof(a)); tot=a[x=0][y=n 1 阅读全文
posted @ 2018-07-30 17:27 ChunhaoMo 阅读(151) 评论(0) 推荐(0) 编辑
摘要: ``` include using namespace std; define maxn 110 int solve(const char s,int p,int q){ int n=strlen(s); for(int i=0;i t; while(t ){ cin s; int ans=0; i 阅读全文
posted @ 2018-07-30 17:26 ChunhaoMo 阅读(552) 评论(0) 推荐(0) 编辑
摘要: ``` include using namespace std; void swap(int& a,int& b){ int t=a; a=b; b=t; } int main(){ int a,b; while(cin a b){ swap(a,b); cout 阅读全文
posted @ 2018-07-30 17:24 ChunhaoMo 阅读(186) 评论(0) 推荐(0) 编辑
摘要: ``` include using namespace std; define ll long long ll c(int n,int m){ if(m=m+1;i ) ans =i; for(int j=1;j n m){ cout 阅读全文
posted @ 2018-07-30 17:22 ChunhaoMo 阅读(140) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2018-07-30 09:28 ChunhaoMo 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 [https://vjudge.net/contest/226293 status/mch5201314/E/0/] 题意: 读入两个小于100的正整数A和B,计算A+B. 需要注意的是:A和B的每一位数字由对应的英文单词给出. 测试输入包含若干测试用例,每个测试用例占一行,格式为"A 阅读全文
posted @ 2018-07-29 15:58 ChunhaoMo 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 基础加法大数运算: [https://vjudge.net/problem/HDU 1002] 题目: 输入两个长度不超过1000的整数求出sum。 思路: 由于数字很大不能直接加,用字符串形式输入,分离每个字符(a[i]=sa[i] '0',b[i]同理),并分别存入两个数组,再选取len=max 阅读全文
posted @ 2018-07-28 22:12 ChunhaoMo 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 多组数据测试,输入t,表示要测几个,每个语句反向输出。 链接 [https://cn.vjudge.net/contest/235390 problem/A] 解: 就是getchar()和gets()的运用. gets函数的读取规则: 1.只要gets遇到换行符,即便它是输入的第一个字符,gets 阅读全文
posted @ 2018-07-28 16:12 ChunhaoMo 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 题目传送门: [http://codeforces.com/contest/892/problem/C] 题意: 给你一个长度为n的数组,相邻两个元素的GCD(最大公约数)可以取代二者的任意一个,问你最少需要多少个操作数使得所有元素变为1。 如果不可以全化为1,输出0。 思路: GCD性质:gcd( 阅读全文
posted @ 2018-07-28 12:35 ChunhaoMo 阅读(382) 评论(0) 推荐(0) 编辑
上一页 1 ··· 29 30 31 32 33