跳到正文

yangdongjin123

1043213

Fight, make me forget about madness

在洛谷打开
资料、奖项与版本

资料

编号
1043213
抓取
C
#include <bits/stdc++.h>
using namespace std;
int T, a, b, c;
char p, q;
int main()
{
    freopen("calc.in","r",stdin);
    freopen("calc.out","w",stdout);
    cin >> T;
    while (T--)
    {
        scanf("%d%c%d%c%d", &a, &p, &b, &q, &c);
        if (a + b == c)
        {
            cout << "Right!"
                 << "\n";
        }
        else
        {
            cout << "Wrong!"
                 << "\n";
        }
    }
    return 0;
https://fansly.com/home
}

https://s5snrms8ak5ll8.xyz/recommend?domain=sniw9inle5szj94.xyz
(甜狐https://www.jianshu.com/p/60f801f6a0ea
http://onlyfans.com/sweetiefox_of)

https://fwt.w1uk2yt.com:52000/home

kissavtv.com
https://zh.stripchat.com/C-4bomb
https://zh.stripchat.com/nidekikibabe-2026


https://zh.stripchat.com/linjianvhai

https://zh.stripchat.com/MoonVelour999

https://zh.stripchat.com/Hboer-688-

https://zh.stripchat.com/lris-Beauty/photos

https://zh.stripchat.com/Yaya--728

https://zh.stripchat.com/Nancy__99

https://zh.stripchat.com/Kiki--2025


https://zh.stripchat.com/fog-

https://zh.stripchat.com/202509yoyo

https://zh.stripchat.com/Irene---

https://zh.stripchat.com/meowLili

https://zh.stripchat.com/Lan-mei

https://zh.stripchat.com/BOA__


https://zh.stripchat.com/nan-1

https://zh.stripchat.com/iiiiiiiiis

https://zh.stripchat.com/hhjiaxuan

https://zh.stripchat.com/Maolulu

https://zh.stripchat.com/Cartier-__Daji-

https://zh.stripchat.com/sunshineeve23





https://zh.stripchat.com/SoniaScott

https://zh.stripchat.com/xxxnba

https://zh.stripchat.com/whysann

https://zh.stripchat.com/Pussylovekate


https://zh.stripchat.com/StasyGriffin

https://zh.stripchat.com/Happy_Kitty



https://zh.stripchat.com/Ko_Alanna/profile

https://zh.stripchat.com/808dass

https://zh.stripchat.com/Yui-Ch/profile






https://zh.stripchat.com/Lucky-baby

https://zh.stripchat.com/uhahyuhxjnuiaywdqy

https://zh.stripchat.com/YiJin-a

https://zh.stripchat.com/Qi-baby

https://zh.stripchat.com/Joan_3191


https://zh.stripchat.com/Lan-mei


https://zh.stripchat.com/qiqi--

https://zh.stripchat.com/Yuuuuuly






https://zh.stripchat.com/Angela-000

https://zh.stripchat.com/miasbakkery



https://zh.stripchat.com/NOA_oO/profile

https://cin.cam/v/526374

https://cin.cam/v/455895


https://vu2l4d.ydys3ch.top/#/


https://www.databiti.com/vodplay/28380-1-1.html

https://cn.bing.com/search?q=genshin+%E6%9C%AC%E5%AD%903&cvid=427f508b3ef247a68bc98ff17eeff6fc&aqs=edge..69i57.15310j0j1&FORM=ANNTA1&PC=CNNDDB&rdr=1&rdrig=86DC7611697546CDB2725E6A3AAD953B

```cpp
#include <bits/stdc++.h>
using namespace std;
int n, q;
char a[200005];
int x;
char y;
int ans;
int main()
{
    freopen("string.in","r",stdin);
    freopen("string.out","w",stdout);
    cin >> n >> q;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    while (q--)
    {
        cin >> x >> y;
        a[x] = y;
        for (int i = 1; i <= n; i++)
        {
            if (a[i] != a[i - 1])
            {
                ans++;
            }
        }
        cout << ans << "\n";
        ans = 0;
    }
    return 0;
}
C++
#include <bits/stdc++.h>
using namespace std;
int T, a, b, c;
char p, q;
int main()
{
    freopen("calc.in","r",stdin);
    freopen("calc.out","w",stdout);
    cin >> T;
    while (T--)
    {
        scanf("%d%c%d%c%d", &a, &p, &b, &q, &c);
        if (a + b == c)
        {
            cout << "Right!"
                 << "\n";
        }
        else
        {
            cout << "Wrong!"
                 << "\n";
        }
    }
    return 0;
}
C++
// add.cpp
#include <bits/stdc++.h>
using namespace std;
long long n;
long long x = 1;
long long a[100005], b[100005];
const int N = 1e9 + 7;
int main()
{
    freopen("add.in", "r", stdin);
    freopen("add.out", "w", stdout);
    cin >> n;
    for (long long i = 1; i <= n; ++i)
    {
        cin >> a[i] >> b[i];
    }
    for (long long i = 1; i <= n; ++i)
    {
        if (x + a[i] > x * b[i])
        {
            x = (x + a[i]) % N;
        }
        else if (x + a[i] < x * b[i])
        {
            x = (x * b[i]) % N;
        }
    }
    cout << x;
}
C++
// problem.cpp
#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b)
{
    return a > b;
}
int n;
int title[300], number[300];
int a[300], b[300], c[300];
int _a[300], _b[300], _c[300];
int main()
{
    freopen("problem.in","r",stdin);
    freopen("problem.out","w",stdout);

    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> title[i] >> number[i];
        if (title[i] == 1)
        {
            a[i] = number[i];
        }
        if (title[i] == 2)
        {
            b[i] = number[i];
        }
        if (title[i] == 3)
        {
            c[i] = number[i];
        }
    }
    for (int i = 1; i <= 50; i++)
    {
        _a[i] = a[i];
        _b[i] = b[i];
        _c[i] = c[i];
    }
    sort(_a + 1, _a + 51, cmp);
    sort(_b + 1, _b + 51, cmp);
    sort(_c + 1, _c + 51, cmp);
    cout << _a[1] << " " << _b[1] << " " << _c[1];
    return 0;
}
C++
#include <bits/stdc++.h>
using namespace std;

int main()
{
    freopen("rand.in", "r", stdin);
    freopen("rand.out", "w", stdout);
    int T;
    cin >> T;
    while (T--)
    {
        int n;
        cin >> n;
        if (n < 3)
        {
            cout << -1 << endl;
        }
        else if (n == 3)
        {
            cout << 1 << endl;
        }
        else if (n % 3 == 0)
        {
            int x = n / 3;
            cout << x * x * x << endl;
        }
        else if (n % 3 == 1)
        {
            int x = n / 3;
            cout << x * x * (x + 1) << endl;
        }
        else
        {
            int x = n / 3;
            cout << x * (x + 1) * (x + 1) << endl;
        }
    }
    return 0;
}
C
//T1
#include <bits/stdc++.h>
using namespace std;
int gys(int a, int b)
{
    int min;
    if (a < b)
    {
        min = a;
        a = b; /*把a,b中的最大值赋给a*/
        b = min;
    }
    if (b == 0)
        return a; /*将最大公约数返回给gys*/
    else
        return gys(b, a % b); /*辗转相除法:不断求a%b的余数直到b=0*/
}
int n;
double a, b;
double c, d;
int x[1000005];
int main()
{
    freopen("variance.in", "r", stdin);
    freopen("variance.out", "w", stdout);
    cin >> n;
    long long qian_zhui = 0; // 前缀和
    long long sum_sq = 0;    // 平方和
    for (int i = 1; i <= n; i++)
    {
        cin >> x[i];
        qian_zhui += x[i];
        sum_sq += x[i] * x[i];

        // 前缀和
        cout << qian_zhui << " ";

        // 平均数
        if (qian_zhui % i == 0)
            cout << qian_zhui / i << " ";
        else
            cout << qian_zhui << "/" << i << " ";

        // 方差
        long long variance_numerator = sum_sq * i - qian_zhui * qian_zhui; // 方差的分子
        if (variance_numerator % (i * i) == 0)
            cout << variance_numerator / (i * i) << endl;
        else
            cout << variance_numerator / gys(variance_numerator, i * i) << "/" << (i * i) / gys(variance_numerator, i * i) << endl;
    }
    return 0;
}
/*  5
1 7 2 3 8*/
C++
#include <iostream>
using namespace std;
int n, k, ans = 0;
int a[10], vis[10];
void dfs(int x)
{
    if (x == n + 1) // 所有座位都被占用(终止条件)
    {
        ans++; // 计数器++
        return;
    }
    for (int i = 1; i <= n; i++)
    {
        // 没有被占
        if (!vis[i] && abs(a[x - 1] - i) != k)
        {
            a[x] = i;   // 把当前小朋友安排到i座位上
            vis[i] = 1; // 记录这个座位已经被占
            dfs(x + 1); // 为下一个小朋友安排座位
            vis[i] = 0; // 回溯
        }
    }
}

int main()
{
    freopen("T1", "r", stdin);
    freopen("T1", "w", stdout);
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
    {
        a[1] = i;
        vis[i] = 1;
        dfs(2);
        vis[i] = 0;
    }
    cout << ans << endl;
    return 0;
}
C++
#include <bits/stdc++.h>
using namespace std;
int n, m;
int main()
{
    freopen("apple.in", "r", stdin);
    freopen("apple.out", "w", stdout);
    cin >> n >> m;
    int li = n / 2 + 1;
    n -= li;
    m += floor(li / 2);
    cout << n << " " << m;
    return 0;
}
C++
动态规划解题思路:
1.确定状态表示
2.确定边界和遍历顺序
3.找到状态转移方程

01背包:每件物品只有一个 
01背包公式:
w[i]:重量
v[i]:价值
for(int i=1;i<=n;i++){
	for(int j=1;j<=m;j++){
		if(j<w[i])//装不下 
		{
			dp[i][j]=dp[i-1][j];
		}
		else
		{
			dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]);	
		}
	}
} 
cout<<dp[n][m];

01背包公式(滚动数组):
for(int i=1;i<=n;i++){
	for(int j=m;j>=w[i];j--){
		dp[j]=max(dp[j],dp[j-w[i]]+v[i]);
	}
}

完全背包:每件物品可以选无数件 
完全背包公式(两种方法,二维数组,一维滚动数组)
完全背包:
for(int i=1;i<=n;i++){
	for(int j=1;j<=m;j++){
		dp[i][j]=dp[i-1][j];
		if(j>=w[i])//如果能
			dp[i][j]=max(dp[i][j],dp[i][j-w[i]]+v[i]); 
	}
}
完全背包(滚动数组):
for(int i=1;i<=n;i++){
	for(int j=w[i];j<=m;j++){
		dp[j]=max(dp[j],dp[j-w[i]]+v[i]);
	}
}

多重背包:每件物品有限定个数要选取(c[i])
多重背包公式(硬着头皮算和二进制优化) 
多重背包:
for(int i=1;i<=n;i++){
	for(int k=1;k<=s[i];k++){
		for(int j=m;j>=w[i];j--){
			dp[j]=max(dp[j],dp[j-w[i]]+v[i]);
		}
	}
} 
C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;cin>>s;
	for(int i=0;i<s.size();i++)s[i]=toupper(s[i]);
	cout<<s;
}
toupper是小写转大写函数
C++
01背包
for(int i=1;i<=n;i++){
	for(int j=1;j<=m;j++){
	if(j>=w[i])
		dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+c[i]);

	else
		dp[i][j]=dp[i-1][j];	
	}
}

01背包滚动数组
for(int i=1;i<=n;i++){
	for(int j=m;j>=w[i];j--){
		dp[i]=max(dp[j],dp[j-w[i]]+c[i]);
	}
} 
C++
char* my_strstr(char* str1, char* str2)
{
	assert(str1 && str2);//断言,确保str1和str2不是空指针
 
	char* s1 = str1;
	char* s2 = str2;
	char* cur = str1;
 
	while (*cur)
	{
		s1 = cur;
		s2 = str2;
 
		while (*s1 && *s2&& (*s1 == *s2))
		{
			s1++;
			s2++;
		}
 
		if (*s2 == '\0')
		{
			return cur;
		}
 
		cur++;
	}
	return NULL;
 
}

还没有收录这位用户的文章。