T天宇Y
T天宇Y
全部文章
分类
归档
标签
去牛客网
登录
/
注册
T天宇Y的博客
全部文章
(共13篇)
题解 | 最厉害的学生
#include <iostream> #include <vector> #include <string> using namespace std; class Student{ private: string name; int c1,c2,...
2026-01-26
0
9
题解 | 一元二次方程
直接把b*b>=4ac当返回条件用也可以 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 判断二元一次方程组是否有解 * @param a int整型...
2026-01-26
0
8
题解 | 牛牛的考试
选项前都是一个字母带个点,可以一起统计长度,用pair让字母跟着选项排序 #include <iostream> #include <vector> #include <string> #include <algorithm> #include <...
2026-01-25
0
9
题解 | 添加逗号
解释一下if,先执行前置的--n,因为是三位一加,所以逗号出现在7,4等位后,先减再判断是否为三的倍数,&&n判断是不是最后一位 #include <iostream> #include <string> using namespace std; int m...
2026-01-25
0
8
题解 | 约瑟夫环
妙妙递推,前面实现起点为0的报数,最后一步加成k,原理是按照最后一个人反推回原来位置 #include <iostream> using namespace std; int main() { int n,k,m;cin>>n>>k>>m; ...
2026-01-25
0
9
题解 | 上三角矩阵判定
无数组写法,然后仅一组方阵可以用return 0来结束 #include <iostream> using namespace std; int main() { int n;cin>>n; for(int i=0;i<n;++i){ ...
2026-01-24
0
12
题解 | 记数问题
我们py玩家是这样的 n,x=map(int,input().split()) s='' for i in range(1,n+1): s+=str(i) print(s.count(str(x)))
2026-01-24
0
9
题解 | 数组计数维护
似乎数组可以不开 #include <iostream> using namespace std; int main() { int t;cin>>t; while(t--){ int n,k;cin>>n>>k; ...
2026-01-24
0
10
题解 | 牛牛的数学作业
方差有个公式,方差=方均-均方(平方和的平均数减平均数的平方) #include <iostream> #include <iomanip> using namespace std; int main() { int t;cin>>t; whil...
2026-01-24
0
9
题解 | 左侧严格小于计数
我们可以选择每次输入都数一次,这种时候复杂度约为0.5*n^2,发现整数的范围较小,所以可以把整数的个数存进一个数组,复杂度约为10*n #include <iostream> using namespace std; int arr[11]; int main() { int ...
2026-01-24
0
12
首页
上一页
1
2
下一页
末页