天元之弈
天元之弈
全部文章
分类
随笔(1)
题解(37)
归档
标签
去牛客网
登录
/
注册
天元之弈的博客
TA的专栏
36篇文章
0人订阅
已写的题解集
36篇文章
1080人学习
全部文章
(共36篇)
题解 | #Math Practice#
思路:直接照着题意模拟就可以了,但要注意一件事。 十年OI一场空 不开longlong见祖宗 其实题目给了提示,不会有人眼瞎看不见吧。 #include <iostream> #include <cmath> using namespace std; long long a...
C++
2022-06-01
0
456
题解 | #[USACO 2010 Nov B]Race Results#
来自专栏
本意思路:运用结构体sort进行排序,这里可以使用运算符重载或写一个cmpcmpcmp函数,我选用的是运算符重载。 sortsortsort底层运用的是<<<运算符,所以我们可以重载<<<运算符。 重载运算符模板: bool operator < (node...
C++
2022-06-01
1
360
题解 | #红鲤鱼与绿鲤鱼与驴#
来自专栏
直接模拟即可。 输出是注意lv中是v不是u。 #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; for (...
C++
2022-06-01
0
459
题解 | #兰大生日快乐#
来自专栏
没什么好说的,太水了,直接puts输出就行了。 #include <iostream> using namespace std; int main() { puts("Happy Birthday LZU!"); return 0; }
2022-06-01
0
354
题解 | #Lake Counting#
来自专栏
这道题可以用dfs也可以用bfs,这里选用bfs。 思路:找到一个W,然后使劲的往下搜,每搜到一个点就把W变成.,直到搜不了。然后再找一个W……(禁止套娃(doge)) #include <iostream> using namespace std; const int N = 105...
2022-05-31
0
451
题解 | #大炼丹师#
来自专栏
hh这道题靠的是三角形判断,下面一一列举。 等边三角形:三条边长度相等(不会有人不知道吧)。 直角三角形:勾股定理,两条直角边平方之和 = 斜边平方。 不是三角形:最短的两条边的和小于第三边。 其他:else判断。 下面看一下代码 #include <iostream>...
2022-05-31
0
524
题解 | #意大利青年的烦恼#
来自专栏
#include <iostream> #include <string> using namespace std; bool pd(string s) { for (int i = 0; i < s.size(); i ++) if (s[...
C++
2022-04-17
1
401
题解 | #肥宅の简单分类#
来自专栏
//这题真恶心 #include <iostream> #include <cstring> using namespace std; const int N = 1005; int a[N], s[5], T, n, flag, f[5]; double sb; vo...
C++
2022-04-16
3
615
题解 | #计科182的回文字符串#
来自专栏
思路有很多种,我们来看最简单的。 就是将给定字符串从头到中点扫描一遍,然后判断每个左字母对应的右字母是否相等。 Code↓Code\downarrowCode↓ #include <iostream> #include <string> using namespace st...
C++
2022-04-16
2
398
题解 | #数列下标#
来自专栏
#include <iostream> using namespace std; const int N = 10005; int n, a[N]; int main() { cin >> n; for (int i = 1; i <= n; i ...
C++
2022-04-11
0
471
首页
上一页
1
2
3
4
下一页
末页