栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

ACM 天梯赛

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ACM 天梯赛

哲哲打游戏
#include
#include
using namespace std;
#define x first
#define y second
map cnt1;
vector cnt[100010];
int re[110];
int main() {
	int n, m;
	scanf("%d%d", &n,&m);
	for (int i = 1; i <=n; i++)
	{
		int k;
		scanf("%d", &k);
		for (int j = 0; j < k; j++)
		{
			int x;
			scanf("%d", &x);
			cnt[i].push_back(x);
		}
	}
	int p = 1;
	for (int i = 0; i < m; i++)
	{
		int a, b;
		scanf("%d%d", &a, &b);
		if (a == 0)
		{
			p = cnt[p][b - 1];
		}
		else if (a == 1)
		{
			re[b] = p;
			cout << p;
			cout << endl;
		}
		else
		{
			p = re[b];
		}
	}
	cout< 
清点代码库 
#include
#include
using namespace std;
#define x first
#define y second
map, int> cnt;
vector>> ans;
int main() {
	int n, m;
	scanf_s("%d%d", &n, &m);
	for (int i = 0; i line;
		for (int j = 0; j < m; j++)
		{
			int a;
			scanf_s("%d", &a);
			line.push_back(a);
		}
		cnt[line]++;
		}
	for (auto& p : cnt)
	{
		ans.push_back({ -p.second,p.first });
	}
	sort(ans.begin(), ans.end());
	cout << ans.size()< 
悄悄关注 
#include
#include
using namespace std;
#define x first
#define y second
map cnt;
struct node
{
	string name;
	int num;
}a[100010];
bool cmp(node a,node b)
{
	return a.name < b.name;
}
int main() {
	int n, m;
	cin>>n;
	for (int i = 0; i>ss;
		cnt[ss]++;
		}
	cin>>m;
	double sum=0;
	for (int i = 0; i < m; i++)
	{
		cin>>a[i].name>>a[i].num;
		sum += a[i].num;
	}
	sum = sum * 1.0 / m;
	sort(a,a+m,cmp);
	int fa = 0;
	for (int i = 0; i < m; i++)
	{
		if (a[i].num > sum && !cnt[a[i].name])
		{
			fa = 1;
			cout << a[i].name;
			if (i < m - 1)
				cout << endl;
		}
	}
	if (fa == 0)
		cout << "Bing Mei You";
}
乘法口诀 2 3 10
#include
#include
using namespace std;
#define x first
#define y second
map cnt1;
vector cnt[100010];
const int n = 1010;
int re[100010];
int main() {
	string a1, a2;int n;
	cin >> a1 >> a2 >> n;
	int k = 2;
	string str = a1 + a2;
	int i = 0, j = 1;
	while(str.size() 
包装机 
#include
#include
using namespace std;
#define x first
#define y second
map cnt1;
vector cnt[100010];
int re[100010];
int main() {
	queue qq[110];
	stack ss;
	char a[1010];
	int n, m, ma;
	cin >> n >> m >> ma;
	for (int i = 1; i <=n; i++)
	{
		char str[10000];
		cin >> str;
		for (int j = 0; j >x,x!=-1)
	{
		if (x == 0)
		{
			if (ss.size())
			{
				cout << ss.top();
				ss.pop();
			}
		}
		if (x > 0)
		{
			if (ss.size() == ma&&qq[x].size())
			{
					cout << ss.top();
					ss.pop();		
			}
			if (qq[x].size())
			{
			ss.push(qq[x].front());
			qq[x].pop();
			}
		}
	}
}
ABCDdefg
#include
#include
using namespace std;
int main() {
	int n;
	cin >> n;
	while (n--)
	{
		char str[10000];
		cin >> str;
		int j;
		for (j = 1; j < strlen(str); j++)
		{
			if (str[j] >= 'a' && str[j] <= 'z')
			{
				if (str[j - 1] >= 'A' && str[j - 1] <= 'Z'&& str[j] != str[j - 1] - 'A' + 'a')
				{
						cout << "N" << endl;
						break;
				}
				if (str[j - 1] >= 'a' && str[j - 1] <= 'z'&& str[j] != str[j - 1] + 1)
				{
						cout << "N" << endl;
						break;
				}
			}
			if (str[j] >= 'A' && str[j] <= 'Z')
			{
				if (str[j - 1] >= 'a' && str[j - 1] <= 'z' && str[j] != str[j - 1] - 'a' + 'A')
				{
					cout << "N" << endl;
					break;
				}
				if (str[j - 1] >= 'A' && str[j - 1] <= 'Z' && str[j] != str[j - 1] + 1)
				{
					cout << "N" << endl;
					break;
				}
			}
		}
		if (j >= strlen(str))cout << "Y" << endl;
	}
}
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/833086.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号