2024年8月11日

ABC366整理:

C:

用一个变量存储背包内现有的球种类数

注: 可能会重

模拟即可

简单的C++ code:
#include <bits/stdc++.h>
//#include <windows.h>
//#include <unistd.h>
using namespace std;
#define endl '\n'
#define TRACE 1
#define tcout TRACE && cout
#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define all(a) (a).begin(),(a).end()
#define rep(name, start, end) for(int name = (start); name <= (end); i ++)
#define xs(n) cout << fixed << setprecision(n)
const int P = 998244353;
const int Base = 3221225477;
const int INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 10, M = 2e6 + 10;
int read()
{
  int x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9')
  {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
  {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * w;
}
void write(int x)
{
  if (x < 0)
  {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
signed main()
{
	fst;
	int n = read();
	int cnt = 0;
	
	map <int, int> mp;
	
	while (n --)
	{
		int op, x;
		cin >> op;
		if(op == 1)
		{
			cin >> x;
			mp[x] ++;
			
			if(mp[x] == 1)
			{
				cnt ++;
			}
		}
		else if(op == 2)
		{
			cin >> x;
			mp[x] --;
			if(mp[x] > 0)
			{
				;
			}
			else
			{
				cnt ---;
			}
		}
		else
		{
			cout << cnt << endl;
		}
	} 
	exit(0);
}



B:

矩阵( \(2\) 维) 题

先不考虑 * , 初始化字符串,全弄成*,然后,对于每个 \(i\)\(j\) ,将 \(S_i\) 的第 \(j\) 个字符分配给 \(T_j\) 的第 \((N-i+1)\) 个字符。现在,除了第二个条件外,所有条件都满足了。要满足第二个条件,对于每个 \(T_i\) ,重复删除以 * 结尾的最后一个字符。

点击查看代码
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

#define TRACE 1
#define tcout TRACE && cout

#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define int long long

const int P = 998244353; 
const int Base = 2281701377;
const int INF = 0x3f3f3f3f3f3f3f3f; 

const int N = 1e2 + 10, M = 2e6 + 10; 

int n;
char a[N][N];
int len[N];
int maxn;
char b[N][N];

signed main()
{
    memset(a, '*', sizeof(a));
    cin >> n;
    for(int i=1; i<=n; i++)
    {
        string s;
        cin >> s;
        len[i] = s.size();
        for(int j=1; j<=len[i]; j++)
        {
            a[i][j] = s[j-1];
        }
        maxn = max(maxn, len[i]);
    }
    for(int i=1, x=1; i<=maxn; i++, x++)
    {
        for(int j=n, y=1; j>=1; j--, y++)
        {
            b[x][y] =  a[j][i];
        }
    }
    for(int i=1; i<=maxn; i++)
    {
        for(int j=n; j>=1; j--)
        {
            if(b[i][j] != '*')
            {
                break;
            }
            else
            {
                b[i][j] = ' ';
            }
        }
    }
    for(int i=1; i<=maxn; i++)
    {
        for(int j=1; j<=n; j++)
        {
            cout << b[i][j];
        }
        cout << endl;
    }
	return 0;
}

A

简单啊!难道还有人 ${\LARGE {\color{Red}Wrong \ Answer} } $ ?

点击查看代码
#include <bits/stdc++.h>
//#include <windows.h>
//#include <unistd.h>
using namespace std;
#define endl '\n'
#define TRACE 1
#define tcout TRACE && cout
#define fst ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define all(a) (a).begin(),(a).end()
#define rep(name, start, end) for(int name = (start); name <= (end); i ++)
#define xs(n) cout << fixed << setprecision(n)
const int P = 998244353;
const int Base = 3221225477;
const int INF = 0x3f3f3f3f3f3f3f3f;
const int N = 1e6 + 10, M = 2e6 + 10;
int read()
{
  int x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9')
  {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
  {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * w;
}
void write(int x)
{
  if (x < 0)
  {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
signed main()
{
	fst;
	int n, a, b;
	cin >> n >> a >> b;
	if((a < b and a + (n - a- b) < b) or (b < a and b + (n - a- b) < a))
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
	exit(0);
}



posted @ 2024-08-11 14:44 张北辰 阅读(8) 评论(0) 推荐(0)

2024年8月9日

摘要: 标题 # 使用 Mackdown语法的标题可以用 #来写 Markdown语法 HTML 预览效果 # Heading level 1 <h1>Heading level 1</h1> # Heading level 1 ## Heading level 2 <h2>Heading level 2< 阅读全文

posted @ 2024-08-09 17:45 张北辰 阅读(36) 评论(0) 推荐(0)

2024年8月6日

摘要: 一个蒟蒻小学生尝试学习高级排列组合 呃呃呃呃呃呃,我不咋会写,如有不对的地方欢迎纠正 紧接上文我们已经了解了基础的排列组合,我们可以接着往下学习排列组合的变种了. 1.排列组合的变种 1-1.多重集的排列数 + 多重组合数 大家一定要区分 多重组合数 与 多重集的组合数!两者是完全不同的概念! 多重 阅读全文

posted @ 2024-08-06 22:29 张北辰 阅读(18) 评论(0) 推荐(0)

摘要: 一个蒟蒻对简单距离的简单理解: 呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃,写的简单粗暴,如有不对的,欢迎纠正 神马是距离? 在数学中,距离是泛函分析中最基本的概念之一。它所定义的距离空间连接了拓扑空间与赋范线性空间等其他空间,是学习泛函分析首先接触的概念。距离,是 阅读全文

posted @ 2024-08-06 22:29 张北辰 阅读(21) 评论(0) 推荐(0)

摘要: ARC181总结 ARC还是太难了 A 标签: 有脑子🧠都会 题意 问题陈述 给出 $(1,2,\dots,N)$ 的排列 $P=(P_1, P_2,\dots,P_N)$ 。 您希望通过执行以下操作零次或多次来满足所有 $i=1,2,\dots,N$ 的 $P_i = i$ : -选择整数 $k 阅读全文

posted @ 2024-08-06 22:29 张北辰 阅读(19) 评论(0) 推荐(0)

摘要: 一个小学生蒟蒻对简单排列组合的认知和了解 呃呃呃呃呃....可能写的有点不咋好...呃呃呃 神马是排列组合 神马是排列组合呢?我感觉我也不太清楚 排列组合是组合数学中的基础。排列就是指从给定个数的元素中取出指定个数的元素进行排序;组合则是指从给定个数的元素中仅仅取出指定个数的元素,不考虑排序。排列组 阅读全文

posted @ 2024-08-06 22:29 张北辰 阅读(26) 评论(0) 推荐(0)

摘要: A-AC 判断闰年,闰年输出:366366366 否则输出: 365365365 code: #include <bits/stdc++.h> using namespace std; #define endl '\n' #define TRACE 1 #define tcout TRACE && 阅读全文

posted @ 2024-08-06 15:58 张北辰 阅读(31) 评论(0) 推荐(0)

2024年7月31日

摘要: 一个蒟蒻对简单距离的简单理解: 呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃呃,写的简单粗暴,如有不对的,欢迎纠正 神马是距离? 在数学中,距离是泛函分析中最基本的概念之一。它所定义的距离空间连接了拓扑空间与赋范线性空间等其他空间,是学习泛函分析首先接触的概念。距离,是 阅读全文

posted @ 2024-07-31 15:52 张北辰 阅读(7) 评论(0) 推荐(0)

2024年7月18日

摘要: 1.蒟蒻几何 几何 @zzy写 介绍 你要问我几何是什么? 我不到啊! 其实几何就是数学的分科 几何是研究空间结构及性质的一门学科。它是数学中最基本的研究内容之一,与分析、代数等等具有同样重要的地位,并且关系极为密切。几何学发展历史悠长,内容丰富。它和代数、分析、数论等等关系极其密切。几何思想是数学 阅读全文

posted @ 2024-07-18 15:35 张北辰 阅读(19) 评论(0) 推荐(0)

点击右上角即可分享
微信分享提示