第一次完整的做一场codeforces !!!!!!(Codeforces Round #483 (Div. 2) [Thanks, Botan Investments and Victor Sha)

将3DMax编辑的动画,导入给已经绑定蒙皮好的模型给Unity使用 现在程序猿想做独立游戏,即容易,也难。 说容易,引擎越来越傻瓜化。 说难,到哪去找靠谱的美术? 好在伟大的AssetStore(还有淘宝上)有大批不赖的资源可以用。 现成的模型,是好,但是,没有配套的动作,却是一件让人头疼的事情,即使用IK动画,也不能完美的弥补这一缺陷。 虽然Unity具备 retargeting 功能,但是,也不是万能的,很多情况下,非标准的骨骼会导致 阅读详情
A. Game
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Two players play a game.

Initially there are nn integers a1,a2,…,ana1,a2,…,an written on the board. Each turn a player selects one number and erases it from the board. This continues until there is only one number left on the board, i. e. n−1n−1 turns are made. The first player makes the first move, then players alternate turns.

The first player wants to minimize the last number that would be left on the board, while the second player wants to maximize it.

You want to know what number will be left on the board after n−1n−1 turns if both players make optimal moves.

Input

The first line contains one integer nn (1≤n≤10001≤n≤1000) — the number of numbers on the board.

The second line contains nn integers a1,a2,…,ana1,a2,…,an (1≤ai≤1061≤ai≤106).

Output

Print one number that will be left on the board.

Examples
input
Copy
3
2 1 3
output
Copy
2
input
Copy
3
2 2 2
output
Copy
2
Note

In the first sample, the first player erases 33 and the second erases 11. 22 is left on the board.

In the second sample, 22 is left on the board regardless of the actions of the players.

#include<bits/stdc++.h>
using namespace std;
int main()
{
		int n;
				int a[1005];
		cin>>n;
		memset(a,0,sizeof(a));

		for(int i=0;i<n;i++){
			cin>>a[i];
		}
		sort(a,a+n);
		if(n%2==0)
		cout<<a[n/2-1]<<endl;
		else
		cout<<a[n/2]<<endl;
	return 0;
}

B. Minesweeper
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Minesweeper that time. He imagined that he saved world from bombs planted by terrorists, but he rarely won.

Alex has grown up since then, so he easily wins the most difficult levels. This quickly bored him, and he thought: what if the computer gave him invalid fields in the childhood and Alex could not win because of it?

He needs your help to check it.

A Minesweeper field is a rectangle n×mn×m, where each cell is either empty, or contains a digit from 11 to 88, or a bomb. The field is valid if for each cell:

  • if there is a digit kk in the cell, then exactly kk neighboring cells have bombs.
  • if the cell is empty, then all neighboring cells have no bombs.

Two cells are neighbors if they have a common side or a corner (i. e. a cell has at most 88 neighboring cells).

Input

The first line contains two integers nn and mm (1≤n,m≤1001≤n,m≤100) — the sizes of the field.

The next nn lines contain the description of the field. Each line contains mm characters, each of them is "." (if this cell is empty), "*" (if there is bomb in this cell), or a digit from 11 to 88, inclusive.

Output

Print "YES", if the field is valid and "NO" otherwise.

You can choose the case (lower or upper) for each letter arbitrarily.

Examples
input
Copy
3 3
111
1*1
111
output
Copy
YES
input
Copy
2 4
*.*.
1211
output
Copy
NO
Note

In the second example the answer is "NO" because, if the positions of the bombs are preserved, the first line of the field should be *2*1.

You can read more about Minesweeper in Wikipedia's article.

#include<bits/stdc++.h>
using namespace std;
int main()
{
	char mp[200][200];
	int n,m;
	int mp1[200][200];
	int mp2[200][200];
	cin>>n>>m;
	{
		memset(mp1,0,sizeof(mp1));
		memset(mp2,0,sizeof(mp2));
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++){
				cin>>mp[i][j];
				if(mp[i][j]=='*')
				{
					mp1[i][j]=-9999;
					mp2[i][j]=-9999;
					mp1[i+1][j]+=1;
					mp1[i+1][j+1]+=1;
					mp1[i-1][j]+=1;
					mp1[i-1][j-1]+=1;
					mp1[i][j-1]+=1;
					mp1[i][j+1]+=1;
					mp1[i+1][j-1]+=1;
					mp1[i-1][j+1]+=1;

				}
				else if(mp[i][j]=='.')
				{
					mp2[i][j]=0;
				}
				else
				{
					mp2[i][j]+=mp[i][j]-'0';
				}
			}
		}
				for(int i=1;i<=n;i++){
					for(int j=1;j<=m;j++){
						if(mp1[i][j]>=0&&mp2[i][j]>=0){
							if(mp1[i][j]!=mp2[i][j])
							{
								cout<<"NO"<<endl;
								return 0;
							}
						}
					}
				}
				cout<<"YES"<<endl;
	}
return 0;
}
C. Finite or not?
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

You are given several queries. Each query consists of three integers pp, qq and bb. You need to answer whether the result of p/qp/q in notation with base bb is a finite fraction.

A fraction in notation with base bb is finite if it contains finite number of numerals after the decimal point. It is also possible that a fraction has zero numerals after the decimal point.

Input

The first line contains a single integer nn (1≤n≤1051≤n≤105) — the number of queries.

Next nn lines contain queries, one per line. Each line contains three integers pp, qq, and bb (0≤p≤10180≤p≤1018, 1≤q≤10181≤q≤1018, 2≤b≤10182≤b≤1018). All numbers are given in notation with base 1010.

Output

For each question, in a separate line, print Finite if the fraction is finite and Infinite otherwise.

Examples
input
Copy
2
6 12 10
4 3 10
output
Copy
Finite
Infinite
input
Copy
4
1 1 2
9 36 2
4 12 3
3 5 4
output
Copy
Finite
Finite
Finite
Infinite
Note

612=12=0,510612=12=0,510

43=1,(3)1043=1,(3)10

936=14=0,012936=14=0,012

412=13=0,13412=13=0,13

#include<bits/stdc++.h>
#define _max 5000
using namespace std;
long long gcd(long long a,long long b){
	return b==0?a:gcd(b,a%b);
}
int main(){
	ios::sync_with_stdio(false);//这个会提高速度,不加会tl
	int n;
	cin>>n;
	while(n--){
		long long p,q,b;
		cin>>p>>q>>b;
		long long g=gcd(p,q);
		q/=g;
		b=gcd(q,b);
		while(b!=1){
			while(q%b==0)q/=b;
			b=gcd(q,b);
		}
		if(q==1) cout<<"Finite"<<endl;
		else cout<<"Infinite"<<endl;
	}
}

D. XOR-pyramid
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

For an array bb of length mm we define the function ff as

f(b)={b[1]if m=1f(b[1]⊕b[2],b[2]⊕b[3],…,b[m−1]⊕b[m])otherwise,f(b)={b[1]if m=1f(b[1]⊕b[2],b[2]⊕b[3],…,b[m−1]⊕b[m])otherwise,

where ⊕⊕ is bitwise exclusive OR.

For example, f(1,2,4,8)=f(1⊕2,2⊕4,4⊕8)=f(3,6,12)=f(3⊕6,6⊕12)=f(5,10)=f(5⊕10)=f(15)=15f(1,2,4,8)=f(1⊕2,2⊕4,4⊕8)=f(3,6,12)=f(3⊕6,6⊕12)=f(5,10)=f(5⊕10)=f(15)=15

You are given an array aa and a few queries. Each query is represented as two integers ll and rr. The answer is the maximum value of ffon all continuous subsegments of the array al,al+1,…,aral,al+1,…,ar.

Input

The first line contains a single integer nn (1≤n≤50001≤n≤5000) — the length of aa.

The second line contains nn integers a1,a2,…,ana1,a2,…,an (0≤ai≤230−10≤ai≤230−1) — the elements of the array.

The third line contains a single integer qq (1≤q≤1000001≤q≤100000) — the number of queries.

Each of the next qq lines contains a query represented as two integers ll, rr (1≤l≤r≤n1≤l≤r≤n).

Output

Print qq lines — the answers for the queries.

Examples
input
Copy
3
8 4 1
2
2 3
1 2
output
Copy
5
12
input
Copy
6
1 2 4 8 16 32
4
1 6
2 5
3 4
1 2
output
Copy
60
30
12
3
Note

In first sample in both queries the maximum value of the function is reached on the subsegment that is equal to the whole segment.

In second sample, optimal segment for first query are [3,6][3,6], for second query — [2,5][2,5], for third — [3,4][3,4], for fourth — [1,2][1,2].



#include<bits/stdc++.h>
#define _max 5000
using namespace std;
int a[_max],dp[_max][_max],ans[_max][_max];
int main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;i++) {
		cin>>a[i];
		dp[i][i]=a[i];
		ans[i][i]=a[i];
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j+i<=n;j++){
			int t=i+j;
			dp[j][t]=dp[j+1][t]^dp[j][t-1];
			ans[j][t]=max(dp[j][t],max(ans[j+1][t],ans[j][t-1]));
		}
	}
	int q;
	cin>>q;
	while(q--){
		int l,r;
		cin>>l>>r;
		cout<<ans[l][r]<<endl;
	}
	return 0;
}
E. Elevator
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

You work in a big office. It is a 9 floor building with an elevator that can accommodate up to 4 people. It is your responsibility to manage this elevator.

Today you are late, so there are queues on some floors already. For each person you know the floor where he currently is and the floor he wants to reach. Also, you know the order in which people came to the elevator.

According to the company's rules, if an employee comes to the elevator earlier than another one, he has to enter the elevator earlier too (even if these employees stay on different floors). Note that the employees are allowed to leave the elevator in arbitrary order.

The elevator has two commands:

  • Go up or down one floor. The movement takes 1 second.
  • Open the doors on the current floor. During this operation all the employees who have reached their destination get out of the elevator. Then all the employees on the floor get in the elevator in the order they are queued up while it doesn't contradict the company's rules and there is enough space in the elevator. Each employee spends 1 second to get inside and outside the elevator.

Initially the elevator is empty and is located on the floor 1.

You are interested what is the minimum possible time you need to spend to deliver all the employees to their destination. It is not necessary to return the elevator to the floor 1.

Input

The first line contains an integer n (1 ≤ n ≤ 2000) — the number of employees.

The i-th of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 9, ai ≠ bi) — the floor on which an employee initially is, and the floor he wants to reach.

The employees are given in the order they came to the elevator.

Output

Print a single integer — the minimal possible time in seconds.

Examples
input
Copy
2
3 5
5 3
output
Copy
10
input
Copy
2
5 3
3 5
output
Copy
12
Note

正在解决


手把手教你学SOME/IP「3.2.1.发布/订阅行为」 本文详细介绍了SOME/IP协议中的服务发现机制,重点解析了发布/订阅行为的流程。主要内容包括:1)服务发布与Method通信流程,涵盖find/offer报文交互、TTL保活机制及异常处理;2)服务订阅与Event通信流程,包括subscribe/ack报文交互和组播延迟机制;3)特殊场景如快速发送、半周期回复、重置订阅等机制。通过邮局订阅报纸的类比,帮助理解服务发现的核心原理,并强调流程图对于问题定位的重要性。文章为SOME/IP协议的工程实现提供了实用指导。 阅读详情

相关推荐

从单应矩阵到实际距离:Apriltag测距完整实现指南

本文提供了基于Apriltag实现高精度视觉测距与姿态估计的完整指南。详细阐述了从相机标定、单应矩阵分解到欧拉角与距离计算的完整流程,并深入探讨了四个解的歧义选择、工程实践中的滤波优化与多Tag融合等关键问题,旨在帮助开发者在机器人、AR等应用中实现稳定可靠的距离检测与姿态估计。

n7o8p的博客 559

codeforce---------Game

Two players play a game. Initially there are nn integers a1,a2,…,ana1,a2,…,an written on the board. Each turn a player selects one number and erases it from the board. This continues until there is on...

qq_45772483的博客 439

一文读懂客户健康度

什么是客户健康度?客户健康度为什么重要?怎么计算客户健康度?这篇文章,我们来聊聊。

m0_62700043的博客 1420

Codeforces Round #483 (Div. 2) [Thanks, Botan Investments and Victor Shaburov!]

题目链接:http://codeforces.com/contest/984 A. Game time limit per test:2 seconds memory limit per test:512 megabytes input:standard input output:standard output Two pl...

di6499的博客 243

保姆级教程:从Salmon输出到DESeq2,搞定RNA-seq表达矩阵标准化与下游分析准备

本文提供从Salmon输出到DESeq2标准化的RNA-seq数据分析全流程指南,详细解析表达矩阵构建、标准化方法选择及下游分析准备。重点介绍如何将Salmon定量结果转换为DESeq2兼容格式,包括TPM与原始计数的处理技巧,以及常见问题排查方法,帮助研究人员高效完成RNA-seq数据分析。

weixin_42699679的博客 305

1. Klipper从安装到运行

本文记录Klipper固件从安装,配置到运行的详细过程

weixin_42098934的博客 1万+

Codeforces Round #483 [Thanks, Botan Investments and Victor Shaburov!] Editoral

T1:A. Gametime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputTwo players play a game.Initially there are nn integers a1,a2,…,ana1,a2,…,an written on ...

howell 448

基于YOLOv10的微小目标检测,多头检测器提升小目标检测精度

引入多头检测器助力YOLOv10,暴力提升小目标检测性能

①答疑群聊服务;②YOLO大模型知识问答系统;③计算机视觉论文生成智能体; 2571

Codeforces-984B - Minesweeper - 暴力

题解链接: https://lucien.ink/archives/210/ 题目链接: http://codeforces.com/contest/984/problem/B 题目: One day Alex decided to remember childhood when computers were not too powerful and lots of people...

LucienShui 987

SAP Joule 经过了超过 2.5 亿行 ABAP 代码的训练之后......

披露的统计数据,Joule 提供的这种全新系统交互方式,可将事务性任务执行速度提高 90%,访问 SAP Help Portal 内容的速度提高 95%。在 ABAP 应用开发领域,SAP 官网数据显示,Joule 经过超过 2.5 亿行 ABAP 代码的训练,有信心成为这一领域行业领先的代码助手。刚刚过去的 SAP 蓝宝石大会上,SAP 提到,从2023年第四季度以来,SAP 已经交付了 50 项基于人工智能的创新。让其生成 SAP 应用能够识别的结构化应用数据,业务用户全程无需离开 SAP 应用程序。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 800

大疆 2021 嵌入式笔试题

在深圳做嵌入式,大疆公司绝对是 Top 级别的,大疆的技术栈也很深。

qq_38769551的博客 2496

Codeforces-984A - Game - 思维

题解链接: https://lucien.ink/archives/209/ 题目链接: http://codeforces.com/contest/984/problem/A 题目: Two players play a game. Initially there are n integers a1,a2,…,ana1,a2,…,ana_1,a_2,…,a_n written...

LucienShui 819

【完整梳理验证】企业微信第三方应用接入全流程java版

由企业内部的开发者自己开发部署,相当于是企业自己的资产,调用接口基本没有任何限制。由SaaS服务商的开发者开发并部署在服务商侧,面向所有企业。需要企业授权使用(先试用后付费),服务商仅可获取企业授权部分的权限,相当于白名单控制。由服务商的开发者开发,但部署在企业内部。一般是线下签约采购方式,因此权限几乎与自建应用无异,企业管理员只需要配置不对服务商开放的敏感权限,相当于黑名单控制。服务商后台地址:企业微信服务商官网企业管理后台地址:企业微信管理后台服务商,可以理解为 SAAS 中的运营端。企业管理端,可以理

Hello, New World! 2767

Codeforces Round #483 (Div. 1) [Thanks, Botan Investments and Victor Shaburov!] C. Elevator(dp)

题目链接:http://codeforces.com/contest/983/problem/C按照题解的dp写的,关键点在于,每次电梯接人的时候,电梯里最多有3个人,所以,只用记录三个人想去那几个楼层,记忆化搜索一下就好了。貌似在这个状态挺难设计的啊?代码:#include&lt;bits/stdc++.h&gt; #define pb push_back using namespace std...

bibibibi的博客 304

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Codeforces Round #483 (Div. 1) [Thanks, Botan Investments and Victor Shaburov!] A. Finite or not?

题目大意 给出一个在101010进制中分数pq\frac{p}{q}qp​,问其在bbb进制下,是否是有限小数。 时间限制 1s 数据范围 p,q,b≤1018p,q,b\le 10^{18}p,q,b≤1018 题解 先考虑在101010进制下,如何判断一个分数是否为有限小数。 先对pq\frac{p}{q}qp​进行约分,得到最简分数,此时ppp已经毫无意义了。 如果∃x\exist x∃x使得q∣10xq|10^xq∣10x那么就是有限小数了。 但是,这个xxx并不好找,而且如此大的数运算起来也是非常

lijf2001的博客 176

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

Codeforces Round #483 (Div. 2)题解

A. Game time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Two players play a game. Initially there arennintegersa...

weixin_30851409的博客 433

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

【AtCoder ABC 075 B】Minesweeper

【链接】 我是链接,点我呀:) 【题意】 在这里输入题意 【题解】 模拟,把#换成1 八个方向加一下就好。 【代码】 #include <bits/stdc++.h> using namespace std; const int N = 50; const int dx[8] = { 1,1,1,0,0,-1,-...

weixin_30651273的博客 240

#483(div.2) B. Minesweeper

题目地址:http://codeforces.com/contest/984/problem/B题目:One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Mi...

做题记录 559

984B. Minesweeper

B. Minesweepertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alex decided to remember childhood when computers were not too powerful and l...

memory_qianxiao的博客 740

CF984B Minesweeper

原题链接:http://codeforces.com/contest/984/problem/B Minesweeper One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjo...

ShadyPi的IT笔记 357

sgu-239 Minesweeper

题目大意:给你一个2∗N2*N的扫雷棋盘,我们假设是22列NN行(反正无所谓),摈并且第11列没有雷,然后题目已经告诉你第一列的格子点开后中间的数字。然后要你求第二列有多少种布雷的方案。解题思路:首先你得会玩扫雷。。(不会的出门左转阳台不送) 然后我们观察可以发现,如果我们确定了第22列第11行,那么我们就可以推出所有的雷了,所以我们只需要枚举一下第22列第11行是否有雷就行了,时间复杂度O(N)

zzj的专栏 832

A. Game

Two players play a game. Initially there are nn integers a1,a2,…,ana1,a2,…,an written on the board. Each turn a player selects one number and erases it from the board. This continues until there is on...

人间烟火气,最抚凡人心 427

CodeForces - 813C(最短路径水题)

The Tag Game  Alice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. Now the game should be played on an undirected rooted tree of n vertices.

OttsWang的博客 785

Problem B: Minesweeper

UVA一道简单的编程题,,关于扫雷的,居然出错,郁闷了一下,自己试明明是对的 Have you ever played Minesweeper? It's a cute little game which comes within a certain Operating System which name we can't really remember. Well, the

Backer 890

TYUT-codeforce-----Minesweeper

Minesweeper One day Alex decided to remember childhood when computers were not too powerful and lots of people played only default games. Alex enjoyed playing Minesweeper that time. He imagined that h...

weixin_45855809的博客 304

Codeforces Round #483 (Div. 2) B. Minesweeper

B. Minesweepertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Alex decided to remember childhood when computers were not too powerful and l...

恒持此志成永志 375
上一篇: kuangbin专题二 搜索进阶 A - Eight
下一篇: kuangbin专题二 搜索进阶 I - A计划
Unclebighead
博客等级 码龄9年 3粉丝 65原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值