摘要: 题意:给你三个点A(x,y),B(x,y),C(x,y),求∠ABC的度数,输出保留两位小数。 解法:余弦定理求出cos∠ABC的大小,根据PI=180°进行转换。 1 #include <stdio.h> 2 #include <math.h> 3 using namespace std; 4 f 阅读全文
posted @ 2020-02-19 17:30 留幸愉 阅读(307) 评论(0) 推荐(0) 编辑
摘要: 题意:一个字符串的非空子串是指字符串中长度至少为1 的连续的一段字符组成的串。例如,字符串aaab 有非空子串a, b, aa, ab, aaa, aab, aaab,一共7 个。注意在计算时,只算本质不同的串的个数。请问,字符串0100110001010001 有多少个不同的非空子串? 1 #in 阅读全文
posted @ 2020-02-19 12:48 留幸愉 阅读(811) 评论(0) 推荐(0) 编辑
摘要: 题意:打印字母X n=1 X n=2 X X X X X 对于给出的n,输出打印机n层打印结果( n<=7 ),输入多组数据,输入以 -1 结束 每组数据输出完毕,下行输出一个 "-"。 1 #include <iostream> 2 #include <algorithm> 3 #include 阅读全文
posted @ 2020-02-19 08:54 留幸愉 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 题意:两个数相加,计算A+B的和,输出每两组答案之间有个换行。 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <set> 5 #include <vector> 6 #include <map> 阅读全文
posted @ 2020-02-17 10:45 留幸愉 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 题意:有n个人一起吃饭,有些人相互认识,有些人不认识,认识的人只想和认识的人一起吃饭,不想和 陌生人一起吃饭,问需要几张桌子。 题解:并查集 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 con 阅读全文
posted @ 2020-02-14 18:09 留幸愉 阅读(106) 评论(0) 推荐(0) 编辑
摘要: A.Three Strings 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int N = 1e5 + 7; 5 const int inf = 0x3f3f3f3f; 6 cha 阅读全文
posted @ 2020-02-14 16:57 留幸愉 阅读(232) 评论(0) 推荐(0) 编辑
摘要: A.Erasing Zeroes 题解:暴力即可,统计区间1的0。 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 int t; 5 char s[110]; 6 int main() 7 { 8 阅读全文
posted @ 2020-02-13 22:32 留幸愉 阅读(203) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-02-10 15:55 留幸愉 阅读(13) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; typedef long long ll; int n,col; char c; int main() { std::ios::sync_with_stdio(false); cin.tie(0); std: 阅读全文
posted @ 2020-02-03 17:19 留幸愉 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 题解:签到题,直接输出题干要求。 #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { std::ios::sync_with_stdio(false); cin.tie(0); std::c 阅读全文
posted @ 2020-02-03 00:27 留幸愉 阅读(127) 评论(0) 推荐(0) 编辑