题解列表

筛选

三数取最大的两种方法

摘要:解题思路: 1. 先声明变量,获取储存位置。               2. 利用第一步的变量,利用scanf函数获取用户的输入。               3. 利用if 条件语句,或者三目运算……

鸡尾酒疗法C语言解法

摘要:解题思路:数组思想注意事项:参考代码:#include<stdio.h>int ans[10001];int main(){    int n,i,y1,y2;    int a,b;    floa……

2997: 梯形面积

摘要:#2997: 梯形面积 ####直接算出答案输出就行了 ![](/image_editor_upload/20221228/20221228063013_78859.jpg) ```c #in……

单词分析--实现代码

摘要:参考代码:#include <bits/stdc++.h> using namespace std; string s; int nu[27]; int main() {   cin>>s……

tarjan + lca + 树上差分

摘要:# 思路 * 主要讲讲怎么在边上树上差分吧 具体的思路就是,将要查询`diff[u] +=1,diff[v] += 1, diff[lca]-=2`,然后 * 状态一 ![](/image……

整数的个数

摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){    int a,b,c=0,d=0,e=0;   cin>>a;  ……

数学问题:牛吃牧草

摘要:解题思路:设原本牧草量为z,每头牛每天吃x,每天生长为y15*x*20=20*y+z20*x*10=10*y+zz为无关变量消去z100x=10y10x=y所以够10头牛吃1天注意事项:参考代码:……

我的代码最垃圾(哭)

摘要:解题思路:注意事项:参考代码:#include <stdio.h>#include <string.h>#define N 100010typedef struct {    int a, b;} i……